Skip to contentSkip to conversation

sdp: Check for correct pkt size received instead of error

PATCH Applied Andrei Emeltchenko 2 participants 2 messages Oct 1, 2013 – Oct 2, 2013 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sdp: Check for correct pkt size received instead of error

From: Andrei Emeltchenko <[email protected]>

Check that the full header is received in recv().

---
 src/sdpd-server.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/sdpd-server.c +1 -1
index 7b1351f..10e46a1 100644
@@ -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;
 	}
Signature · 1 line
1.7.10.4
#1 lore raw

Hi Andrei,

Quoted 4 lines · Andrei Emeltchenko

Check that the full header is received in recv().

---
 src/sdpd-server.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied. Thanks.

Johan