OSDN Git Service

sdp: Check for correct pkt size received instead of error
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Tue, 1 Oct 2013 11:57:34 +0000 (14:57 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 2 Oct 2013 11:11:08 +0000 (14:11 +0300)
Check that the full header is received in recv().

src/sdpd-server.c

index 7b1351f..10e46a1 100644 (file)
@@ -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;
        }