changeset 16171:3e400c5b0b51

simple-crashfix.diff from achris in ticket #98. This is a fix for the crasher, as opposed to the fix for the bug that triggered the crasher.
author Richard Laager <rlaager@wiktel.com>
date Sun, 15 Apr 2007 22:55:36 +0000
parents 8150347691d2
children 19eba0e74b49
files libpurple/protocols/simple/simple.c
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/simple/simple.c	Sun Apr 15 22:32:23 2007 +0000
+++ b/libpurple/protocols/simple/simple.c	Sun Apr 15 22:55:36 2007 +0000
@@ -593,12 +593,16 @@
 	GSList *transactions = sip->transactions;
 	gchar *cseq = sipmsg_find_header(msg, "CSeq");
 
-	while(transactions) {
-		trans = transactions->data;
-		if(!strcmp(trans->cseq, cseq)) {
-			return trans;
+	if (cseq) {
+		while(transactions) {
+			trans = transactions->data;
+			if(!strcmp(trans->cseq, cseq)) {
+				return trans;
+			}
+			transactions = transactions->next;
 		}
-		transactions = transactions->next;
+	} else {
+		purple_debug(PURPLE_DEBUG_MISC, "simple", "Received message contains no CSeq header.\n");
 	}
 
 	return NULL;