[Commits] cssparser.c 1.1.2.3 1.1.2.4

colin at claws-mail.org colin at claws-mail.org
Wed Feb 13 10:19:52 CET 2013


Update of /home/claws-mail/plugins/gtkhtml2_viewer/libgtkhtml/css
In directory srv:/tmp/cvs-serv4565/libgtkhtml/css

Modified Files:
      Tag: gtk2
	cssparser.c 
Log Message:
2013-02-13 [colin]	0.34.0cvs3

	* libgtkhtml/css/cssparser.c
		Fix infinite loop when parsing unhandled CSS
		Fixes bug #2870, '100% CPU; CM non-responsive'

Index: cssparser.c
===================================================================
RCS file: /home/claws-mail/plugins/gtkhtml2_viewer/libgtkhtml/css/Attic/cssparser.c,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- cssparser.c	1 Jul 2009 15:45:14 -0000	1.1.2.3
+++ cssparser.c	13 Feb 2013 09:19:50 -0000	1.1.2.4
@@ -1275,7 +1275,7 @@
 			
 			tmp_pos = css_parser_parse_whitespace (buffer, tmp_pos, cur_pos);
 
-			if (tmp_pos == cur_pos)
+			if (tmp_pos == cur_pos || tmp_pos < 0)
 				break;
 			
 			if (buffer[tmp_pos] == ',') {
@@ -1508,10 +1508,10 @@
 			}
 		}
 		else {
-			CssRuleset *ruleset;
+			CssRuleset *ruleset = NULL;
 			pos = css_parser_parse_ruleset (buffer, pos, end_pos, &ruleset, base_url);
 
-			if (ruleset) {
+			if (pos >= 0 && ruleset) {
 				CssStatement *rulestatement;
 				rulestatement = g_new0 (CssStatement, 1);
 				rulestatement->type = CSS_RULESET;



More information about the Commits mailing list