From: Andrei Emeltchenko Date: Tue, 1 Oct 2013 11:57:34 +0000 (+0300) Subject: sdp: Check for correct pkt size received instead of error X-Git-Tag: android-x86-4.4-r3~7552 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=15954a450ec67b257f745ce2885d7639fff504e3;p=android-x86%2Fexternal-bluetooth-bluez.git sdp: Check for correct pkt size received instead of error Check that the full header is received in recv(). --- diff --git a/src/sdpd-server.c b/src/sdpd-server.c index 7b1351f81..10e46a1be 100644 --- a/src/sdpd-server.c +++ b/src/sdpd-server.c @@ -166,7 +166,7 @@ static gboolean io_session_event(GIOChannel *chan, GIOCondition cond, gpointer d } len = recv(sk, &hdr, sizeof(sdp_pdu_hdr_t), MSG_PEEK); - if (len <= 0) { + if (len != sizeof(sdp_pdu_hdr_t)) { sdp_svcdb_collect_all(sk); return FALSE; }