# HG changeset patch # User Daniel Atallah # Date 1241293185 0 # Node ID 5e6999b6b5e427b78ea753c9f587d7acb7e75ac5 # Parent d8ce4de7137f26ca41500fffacd9a07feb7f61ef Prevent a NUL ptr deref caused by a malformed session_id. This came out of the veracode analysis. diff -r d8ce4de7137f -r 5e6999b6b5e4 libpurple/protocols/msn/httpconn.c --- a/libpurple/protocols/msn/httpconn.c Sat May 02 19:33:22 2009 +0000 +++ b/libpurple/protocols/msn/httpconn.c Sat May 02 19:39:45 2009 +0000 @@ -219,7 +219,13 @@ g_free(tmp); t = strchr(full_session_id, '.'); - session_id = g_strndup(full_session_id, t - full_session_id); + if (t != NULL) + session_id = g_strndup(full_session_id, t - full_session_id); + else { + purple_debug_error("msn", "Malformed full_session_id[%s]\n", + full_session_id ? full_session_id : NULL); + session_id = g_strdup(full_session_id); + } if (session_action == NULL || strcmp(session_action, "close") != 0) {