Title: [98344] trunk
Revision
98344
Author
jsc...@chromium.org
Date
2011-10-25 07:24:59 -0700 (Tue, 25 Oct 2011)

Log Message

Check for empty string in parseArcFlag
https://bugs.webkit.org/show_bug.cgi?id=70763

Reviewed by Dirk Schulze.

Source/WebCore:

Test: svg/path-invalid.html

* svg/SVGParserUtilities.cpp:
(WebCore::parseArcFlag):

LayoutTests:

* svg/path-arc-invalid-expected.txt: Added.
* svg/path-arc-invalid.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (98343 => 98344)


--- trunk/LayoutTests/ChangeLog	2011-10-25 14:22:44 UTC (rev 98343)
+++ trunk/LayoutTests/ChangeLog	2011-10-25 14:24:59 UTC (rev 98344)
@@ -1,3 +1,13 @@
+2011-10-25  Justin Schuh  <jsc...@chromium.org>
+
+        Check for empty string in parseArcFlag
+        https://bugs.webkit.org/show_bug.cgi?id=70763
+
+        Reviewed by Dirk Schulze.
+
+        * svg/path-arc-invalid-expected.txt: Added.
+        * svg/path-arc-invalid.html: Added.
+
 2011-10-24  Pavel Podivilov  <podivi...@chromium.org>
 
         Web Inspector: keep old source mapping when new one could not be loaded.

Added: trunk/LayoutTests/svg/path-arc-invalid-expected.txt (0 => 98344)


--- trunk/LayoutTests/svg/path-arc-invalid-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/path-arc-invalid-expected.txt	2011-10-25 14:24:59 UTC (rev 98344)
@@ -0,0 +1,2 @@
+CONSOLE MESSAGE: line 6: Error: Problem parsing d="M0 0 A0 0 0 0 0 0 0 0 0 0"
+If this text is visible the malformed SVG path is handled correctly.

Added: trunk/LayoutTests/svg/path-arc-invalid.html (0 => 98344)


--- trunk/LayoutTests/svg/path-arc-invalid.html	                        (rev 0)
+++ trunk/LayoutTests/svg/path-arc-invalid.html	2011-10-25 14:24:59 UTC (rev 98344)
@@ -0,0 +1,8 @@
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+</script>
+<svg>
+<path d="M0 0 A0 0 0 0 0 0 0 0 0 0"/>
+</svg>
+If this text is visible the malformed SVG path is handled correctly.

Modified: trunk/Source/WebCore/ChangeLog (98343 => 98344)


--- trunk/Source/WebCore/ChangeLog	2011-10-25 14:22:44 UTC (rev 98343)
+++ trunk/Source/WebCore/ChangeLog	2011-10-25 14:24:59 UTC (rev 98344)
@@ -1,3 +1,15 @@
+2011-10-25  Justin Schuh  <jsc...@chromium.org>
+
+        Check for empty string in parseArcFlag
+        https://bugs.webkit.org/show_bug.cgi?id=70763
+
+        Reviewed by Dirk Schulze.
+
+        Test: svg/path-invalid.html
+
+        * svg/SVGParserUtilities.cpp:
+        (WebCore::parseArcFlag):
+
 2011-10-24  Pavel Podivilov  <podivi...@chromium.org>
 
         Web Inspector: keep old source mapping when new one could not be loaded.

Modified: trunk/Source/WebCore/svg/SVGParserUtilities.cpp (98343 => 98344)


--- trunk/Source/WebCore/svg/SVGParserUtilities.cpp	2011-10-25 14:22:44 UTC (rev 98343)
+++ trunk/Source/WebCore/svg/SVGParserUtilities.cpp	2011-10-25 14:24:59 UTC (rev 98344)
@@ -158,6 +158,8 @@
 // and might not have any whitespace/comma after it
 bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag)
 {
+    if (ptr >= end)
+        return false;
     const UChar flagChar = *ptr++;
     if (flagChar == '0')
         flag = false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to