From: <dat...@us...> - 2006-11-17 04:31:22
|
Revision: 17766 http://svn.sourceforge.net/gaim/?rev=17766&view=rev Author: datallah Date: 2006-11-16 20:31:21 -0800 (Thu, 16 Nov 2006) Log Message: ----------- This should prevent a crash when reading a malformed custom emoticon. Also add some debuggering output for when this happens to see if we can figure out the exact scenario. Modified Paths: -------------- trunk/libgaim/protocols/msn/object.c trunk/libgaim/protocols/msn/slp.c trunk/libgaim/protocols/msn/slplink.c Modified: trunk/libgaim/protocols/msn/object.c =================================================================== --- trunk/libgaim/protocols/msn/object.c 2006-11-17 03:29:45 UTC (rev 17765) +++ trunk/libgaim/protocols/msn/object.c 2006-11-17 04:31:21 UTC (rev 17766) @@ -22,6 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "object.h" +#include "debug.h" #define GET_STRING_TAG(field, id) \ if ((tag = strstr(str, id "=\"")) != NULL) \ @@ -94,6 +95,7 @@ if (obj->creator == NULL || obj->size == 0 || obj->type == 0 || obj->location == NULL || obj->friendly == NULL || obj->sha1d == NULL || obj->sha1c == NULL) { + gaim_debug_error("msn", "Discarding invalid msnobj: '%s'\n", str); msn_object_destroy(obj); obj = NULL; } @@ -106,24 +108,13 @@ { g_return_if_fail(obj != NULL); - if (obj->creator != NULL) - g_free(obj->creator); + g_free(obj->creator); + g_free(obj->location); + g_free(obj->real_location); + g_free(obj->friendly); + g_free(obj->sha1d); + g_free(obj->sha1c); - if (obj->location != NULL) - g_free(obj->location); - - if (obj->real_location != NULL) - g_free(obj->real_location); - - if (obj->friendly != NULL) - g_free(obj->friendly); - - if (obj->sha1d != NULL) - g_free(obj->sha1d); - - if (obj->sha1c != NULL) - g_free(obj->sha1c); - if (obj->local) local_objs = g_list_remove(local_objs, obj); Modified: trunk/libgaim/protocols/msn/slp.c =================================================================== --- trunk/libgaim/protocols/msn/slp.c 2006-11-17 03:29:45 UTC (rev 17765) +++ trunk/libgaim/protocols/msn/slp.c 2006-11-17 04:31:21 UTC (rev 17766) @@ -819,6 +819,9 @@ smile = tokens[tok]; obj = msn_object_new_from_string(gaim_url_decode(tokens[tok + 1])); + if (obj == NULL) + break; + who = msn_object_get_creator(obj); sha1c = msn_object_get_sha1c(obj); Modified: trunk/libgaim/protocols/msn/slplink.c =================================================================== --- trunk/libgaim/protocols/msn/slplink.c 2006-11-17 03:29:45 UTC (rev 17765) +++ trunk/libgaim/protocols/msn/slplink.c 2006-11-17 04:31:21 UTC (rev 17766) @@ -147,6 +147,9 @@ { MsnSlpLink *slplink; + g_return_val_if_fail(session != NULL, NULL); + g_return_val_if_fail(username != NULL, NULL); + slplink = msn_session_find_slplink(session, username); if (slplink == NULL) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |