# HG changeset patch # User Mark Doliner # Date 1245374926 0 # Node ID 3ea4e638ce81396cee620a563483c87e1e891d45 # Parent d06f9250cf5a58ec51ad39bc41f6ed3da93a3f7e Yikes. buf is on the stack and shouldn't be freed. This fixes a crash. diff -r d06f9250cf5a -r 3ea4e638ce81 libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Fri Jun 19 00:06:49 2009 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Fri Jun 19 01:28:46 2009 +0000 @@ -2311,13 +2311,11 @@ purple_debug_warning("yahoo","p2p: Got something other than YMSG packet\n"); start = memchr(buf + 1, 'Y', len - 1); - if(start) { - g_memmove(buf, start, len - (start - buf)); - len -= start - buf; - } else { - g_free(buf); + if (start == NULL) return; - } + + g_memmove(buf, start, len - (start - buf)); + len -= start - buf; } pos += 4; /* YMSG */