/pidgin/main: 3f178b52c209: Fix a crash in upnp code introduced ...

Mark Doliner mark at kingant.net
Thu Dec 27 02:20:09 EST 2012


Changeset: 3f178b52c2090e4a253e8c74d9c0d40390eca231
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2012-12-26 23:20 -0800
Branch:	 release-2.x.y
URL: http://hg.pidgin.im/pidgin/main/rev/3f178b52c209

Description:

Fix a crash in upnp code introduced 3 weeks ago.

baseURL was never initialized to NULL, so this would crash if
xmlRootNode did not contain a "URLBase" child.  The bug was
introduced in d79e18b1b043

Also, shouldn't we be using xmlnode_get_data_unescaped() here?

diffstat:

 libpurple/upnp.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff --git a/libpurple/upnp.c b/libpurple/upnp.c
--- a/libpurple/upnp.c
+++ b/libpurple/upnp.c
@@ -256,6 +256,7 @@ purple_upnp_parse_description_response(c
 	}
 
 	/* get the baseURL of the device */
+	baseURL = NULL;
 	if((baseURLNode = xmlnode_get_child(xmlRootNode, "URLBase")) != NULL) {
 		baseURL = xmlnode_get_data(baseURLNode);
 	}



More information about the Commits mailing list