pidgin: 3be463a6: Add a NULL check to fix a crash. Fixes ...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Sun Nov 23 19:55:27 EST 2008


-----------------------------------------------------------------
Revision: 3be463a6c799d2ecdf6c2806ccdcfb3e970799e1
Ancestor: 575efa37b34776f69c5d60a56e003bf3d2887eb0
Author: rlaager at pidgin.im
Date: 2008-11-24T00:01:27
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3be463a6c799d2ecdf6c2806ccdcfb3e970799e1

Modified files:
        libpurple/protocols/simple/simple.c

ChangeLog: 

Add a NULL check to fix a crash.  Fixes #4516.

-------------- next part --------------
============================================================
--- libpurple/protocols/simple/simple.c	c0d9f70b68cf0fb22b0a597232f005b48d7f3275
+++ libpurple/protocols/simple/simple.c	7c1f004831e2c7dbead9b6dc7708ff201c070467
@@ -1630,6 +1630,13 @@ static void process_input(struct simple_
 		cur[0] = '\0';
 		purple_debug_info("simple", "\n\nreceived - %s\n######\n%s\n#######\n\n", ctime(&currtime), conn->inbuf);
 		msg = sipmsg_parse_header(conn->inbuf);
+
+		if(!msg) {
+			/* Should we re-use this error message (from lower in the function)? */
+			purple_debug_misc("simple", "received a incomplete sip msg: %s\n", conn->inbuf);
+			return;
+		}
+
 		cur[0] = '\r';
 		cur += 2;
 		restlen = conn->inbufused - (cur - conn->inbuf);


More information about the Commits mailing list