diff src/gtkthemes.c @ 13133:541486fde12b

[gaim-migrate @ 15495] SF Patch #1419139 from Christophe Chapuis (tofe2tofe) "Tests have been added to check if the '\' character can be skipped in the theme. Another test has been added to check there is no buffer overrun while reading the smiley definition." committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 06 Feb 2006 07:46:35 +0000
parents fe2cb084ab16
children 0cc7773b1d87
line wrap: on
line diff
--- a/src/gtkthemes.c	Mon Feb 06 07:34:55 2006 +0000
+++ b/src/gtkthemes.c	Mon Feb 06 07:46:35 2006 +0000
@@ -172,8 +172,8 @@
 			while  (*i) {
 				char l[64];
 				int li = 0;
-				while (!isspace(*i)) {
-					if (*i == '\\' && *(i+1) != '\0' )
+				while (!isspace(*i) && li < sizeof(l) - 1) {
+					if (*i == '\\' && *(i+1) != '\0' && *(i+1) != '\n' && *(i+1) != '\r')
 						i++;
 					l[li++] = *(i++);
 				}