diff libpurple/protocols/msn/oim.c @ 20858:703147a8b0a7

Prevent null pointer deref to fix CID 338
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 09 Oct 2007 23:45:16 +0000
parents 48ee7ec3426d
children 2097b1664fa3 741c3b5eac21
line wrap: on
line diff
--- a/libpurple/protocols/msn/oim.c	Tue Oct 09 23:42:46 2007 +0000
+++ b/libpurple/protocols/msn/oim.c	Tue Oct 09 23:45:16 2007 +0000
@@ -608,8 +608,9 @@
 	purple_debug_info("MSN OIM:OIM", "%s", xmlmsg);
 
 	node = xmlnode_from_str(xmlmsg, strlen(xmlmsg));
-	if (strcmp(node->name, "MD") != 0) {
-		xmlnode_free(node);
+	if (!node || !node->name || strcmp(node->name, "MD") != 0) {
+		if (node)
+			xmlnode_free(node);
 		return;
 	}