# HG changeset patch # User Daniel Atallah # Date 1241292802 0 # Node ID d8ce4de7137f26ca41500fffacd9a07feb7f61ef # Parent fbcb4088d92358961f7c7186c7bb9001ced91b25 Prevent a NUL ptr deref when the passport is malformed. This came out of the veracode analysis. diff -r fbcb4088d923 -r d8ce4de7137f libpurple/protocols/msn/oim.c --- a/libpurple/protocols/msn/oim.c Sat May 02 19:21:11 2009 +0000 +++ b/libpurple/protocols/msn/oim.c Sat May 02 19:33:22 2009 +0000 @@ -668,9 +668,15 @@ if (tokens[1] != NULL) from = (const char *)tokens[1]; - start = strchr(from, '<') + 1; - end = strchr(from, '>'); - passport = g_strndup(start, end - start); + start = strchr(from, '<'); + if (start != NULL) { + start++; + end = strchr(from, '>'); + if (end != NULL) + passport = g_strndup(start, end - start); + } + if (passport == NULL) + passport = g_strdup(_("Unknown")); g_strfreev(tokens); }