log_reader: Fix an actual crash in the QIP reader.

Thu, 21 Jul 2011 05:39:48 +0000

author
Paul Aurich <darkrain42@pidgin.im>
date
Thu, 21 Jul 2011 05:39:48 +0000
changeset 31982
c63531b35666
parent 31981
dbf62554913d
child 31983
4fa9bac19d37

log_reader: Fix an actual crash in the QIP reader.

This crashes if there's at least two lines, and the
last line doesn't contain a trailing newline.

E.g: "\n<-- foo -->" written to a file.

ChangeLog file | annotate | diff | comparison | revisions
libpurple/plugins/log_reader.c file | annotate | diff | comparison | revisions
--- a/ChangeLog	Thu Jul 21 05:37:06 2011 +0000
+++ b/ChangeLog	Thu Jul 21 05:39:48 2011 +0000
@@ -9,6 +9,9 @@
 	* Fix building with GTK+ earlier than 2.14.0 (GTK+ 2.10 is still the
 	  minimum supported) (#14261)
 
+	libpurple:
+	* Fix a potential crash in the Log Reader plugin when reading QIP logs.
+
 	Gadu-Gadu:
 	* Fixed searching for buddies in public directory. (Tomasz Wasilczyk)
 	  (#5242)
--- a/libpurple/plugins/log_reader.c	Thu Jul 21 05:37:06 2011 +0000
+++ b/libpurple/plugins/log_reader.c	Thu Jul 21 05:39:48 2011 +0000
@@ -1901,7 +1901,7 @@
 			start_log = new_line;
 		}
 
-		if (*c) {
+		if (c && *c) {
 			/* find EOF */
 			c = strchr(c, '\n');
 			c++;

mercurial