changeset 24674:7b10acb20526

Fix CID 399 - I'm reasonably sure this couldn't ever actually cause a NULL deref.
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 10 Dec 2008 02:28:30 +0000
parents 5706043db5b5
children 35d0ce5f319a
files libpurple/protocols/bonjour/jabber.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/jabber.c	Wed Dec 10 02:23:27 2008 +0000
+++ b/libpurple/protocols/bonjour/jabber.c	Wed Dec 10 02:28:30 2008 +0000
@@ -128,7 +128,7 @@
 
 	if (contents) {
 		char *bodystart = strchr(contents, '>');
-		char *bodyend = strrchr(bodystart, '<');
+		char *bodyend = bodystart ? strrchr(bodystart, '<') : NULL;
 		if (bodystart && bodyend && (bodystart + 1) != bodyend) {
 			*bodyend = '\0';
 			memmove(contents, bodystart + 1, (bodyend - bodystart));