changeset 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 a3be7b2e335c
children 817425918f92
files libpurple/protocols/msn/oim.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
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;
 	}