# HG changeset patch # User Ethan Blanton # Date 1252008769 0 # Node ID c4a14bbe1b18729e206829fecc3e42c19dbaefcc # Parent 62edf13f815ba65ad6755f0477a68d0ce97903db Head irc_mirc2* bugs off at the pass with a NULL check diff -r 62edf13f815b -r c4a14bbe1b18 libpurple/protocols/irc/parse.c --- a/libpurple/protocols/irc/parse.c Thu Sep 03 18:20:53 2009 +0000 +++ b/libpurple/protocols/irc/parse.c Thu Sep 03 20:12:49 2009 +0000 @@ -361,7 +361,12 @@ char fg[3] = "\0\0", bg[3] = "\0\0"; int fgnum, bgnum; int font = 0, bold = 0, underline = 0, italic = 0; - GString *decoded = g_string_sized_new(strlen(string)); + GString *decoded; + + if (string == NULL) + return NULL; + + decoded = g_string_sized_new(strlen(string)); cur = string; do { @@ -461,9 +466,14 @@ char *irc_mirc2txt (const char *string) { - char *result = g_strdup (string); + char *result; int i, j; + if (string == NULL) + return NULL; + + result = g_strdup (string); + for (i = 0, j = 0; result[i]; i++) { switch (result[i]) { case '\002':