# HG changeset patch # User Evan Schoenberg # Date 1219805699 0 # Node ID 7fbc99a1481dcfa5cab5b8947a31ebe1fbd98544 # Parent dd4df1a209b78cd91bf2fd2335caea44c272efa4 purple_url_parse() now gracefully handles a url which is wholly invalid. Previously, if sscanf() failed, it would assign *ret_host to g_strdup()'d garbage. Now it assigns it to NULL. This probably fixes more than a single issue, but specifically it fixes a crash which could occur when querying UPnP on a WR641G router in some situations because the router would lead us to look up the url "/ipc". diff -r dd4df1a209b7 -r 7fbc99a1481d libpurple/util.c --- a/libpurple/util.c Wed Aug 27 01:43:09 2008 +0000 +++ b/libpurple/util.c Wed Aug 27 02:54:59 2008 +0000 @@ -3578,7 +3578,10 @@ g_snprintf(port_str, sizeof(port_str), "80"); } - if (f == 1) + if (f == 0) + *host = '\0'; + + if (f <= 1) *path = '\0'; sscanf(port_str, "%d", &port);