--- a/libpurple/protocols/msn/msg.c Sat Mar 16 14:05:51 2013 -0400
+++ b/libpurple/protocols/msn/msg.c Sat Mar 16 14:17:45 2013 -0400
@@ -178,6 +178,8 @@
+ /* NUL-terminate the end of the headers - it'll get skipped over below */ /* Split the headers and parse each one */
@@ -195,10 +197,12 @@
/* The only one I care about is 'boundary' (which is folded from
the key 'Content-Type'), so only process that. */
- if (!strcmp(key, "boundary")) {
+ if (!strcmp(key, "boundary") && value) { char *end = strchr(value, '\"');
- msn_message_set_header(msg, key, value);
+ msn_message_set_header(msg, key, value); @@ -210,18 +214,15 @@
- /*if not MIME content ,then return*/
if (!strcmp(key, "MIME-Version"))
+ /* Ignore MIME-Version header */
- if (!strcmp(key, "Content-Type"))
+ else if (!strcmp(key, "Content-Type")) - if ((c = strchr(value, ';')) != NULL)
+ if (value && (c = strchr(value, ';')) != NULL) if ((charset = strchr(c, '=')) != NULL)