# HG changeset patch # User Christian Hammond # Date 1072485103 0 # Node ID f0784ce8189a275d9348206296a384d9612a6cac # Parent 049443a8c76b6a523281fc485a8da410b0ea3147 [gaim-migrate @ 8604] Although it's not supposed to be possible, someone had a crash from a truncated MSNObject string. This adds some extra safe-guards in parsing. committer: Tailor Script diff -r 049443a8c76b -r f0784ce8189a src/protocols/msn/msnobject.c --- a/src/protocols/msn/msnobject.c Fri Dec 26 21:16:50 2003 +0000 +++ b/src/protocols/msn/msnobject.c Sat Dec 27 00:31:43 2003 +0000 @@ -26,7 +26,8 @@ { \ tag += strlen(id "=\""); \ c = strchr(tag, '"'); \ - obj->field = g_strndup(tag, c - tag); \ + if (c != NULL) \ + obj->field = g_strndup(tag, c - tag); \ } #define GET_INT_TAG(field, id) \ @@ -35,8 +36,11 @@ char buf[16]; \ tag += strlen(id "=\""); \ c = strchr(tag, '"'); \ - strncpy(buf, tag, c - tag); \ - obj->field = atoi(buf); \ + if (c != NULL) \ + { \ + strncpy(buf, tag, c - tag); \ + obj->field = atoi(buf); \ + } \ } MsnObject *