From: <the...@us...> - 2006-12-17 04:59:39
|
Revision: 18011 http://svn.sourceforge.net/gaim/?rev=18011&view=rev Author: thekingant Date: 2006-12-16 20:55:12 -0800 (Sat, 16 Dec 2006) Log Message: ----------- I think this'll fix an occasional "invalid read of size 1 bytes" message from valgrind. I'm not sure when it happens... it seems like it would only happen for invalid packets (ones that don't end in 0xc0 80 or whatever it is) Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo_packet.c Modified: trunk/libgaim/protocols/yahoo/yahoo_packet.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_packet.c 2006-12-16 09:58:26 UTC (rev 18010) +++ trunk/libgaim/protocols/yahoo/yahoo_packet.c 2006-12-17 04:55:12 UTC (rev 18011) @@ -155,8 +155,8 @@ pair->key = strtol(key, NULL, 10); accept = x; /* if x is 0 there was no key, so don't accept it */ - if (pos > len) { - /* Truncated. Garbage or something. */ + if (pos + 1 > len) { + /* Malformed packet! (Truncated--garbage or something) */ accept = FALSE; } @@ -164,7 +164,7 @@ delimiter = (const guchar *)strstr((char *)&data[pos], "\xc0\x80"); if (delimiter == NULL) { - /* Malformed packet! (it doesn't end in 0xc0 0x80) */ + /* Malformed packet! (It doesn't end in 0xc0 0x80) */ g_free(pair); pos = len; continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |