# HG changeset patch # User Mark Doliner # Date 1166331312 0 # Node ID 3043806ad900cfb79c1cb5417e5cb1b6bd29c0bf # Parent 152756b02fca388019265224b8471bcfa8cea382 [gaim-migrate @ 18011] 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) committer: Tailor Script diff -r 152756b02fca -r 3043806ad900 libgaim/protocols/yahoo/yahoo_packet.c --- a/libgaim/protocols/yahoo/yahoo_packet.c Sat Dec 16 09:58:26 2006 +0000 +++ b/libgaim/protocols/yahoo/yahoo_packet.c Sun Dec 17 04:55:12 2006 +0000 @@ -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;