Title: [103880] trunk/Source/WebKit2
Revision
103880
Author
[email protected]
Date
2012-01-01 11:44:03 -0800 (Sun, 01 Jan 2012)

Log Message

EnvironmentUtilities::stripValuesEndingWithString enters an infinite loop if the search value
occurs a component other than the first.

Reviewed by Anders Carlsson.

* Platform/unix/EnvironmentUtilities.cpp:
(WebKit::EnvironmentUtilities::stripValuesEndingWithString): Changed to start the search for
the next colon after the current colon.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (103879 => 103880)


--- trunk/Source/WebKit2/ChangeLog	2012-01-01 19:24:00 UTC (rev 103879)
+++ trunk/Source/WebKit2/ChangeLog	2012-01-01 19:44:03 UTC (rev 103880)
@@ -1,5 +1,16 @@
 2012-01-01  Dan Bernstein  <[email protected]>
 
+        EnvironmentUtilities::stripValuesEndingWithString enters an infinite loop if the search value
+        occurs a component other than the first.
+
+        Reviewed by Anders Carlsson.
+
+        * Platform/unix/EnvironmentUtilities.cpp:
+        (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Changed to start the search for
+        the next colon after the current colon.
+
+2012-01-01  Dan Bernstein  <[email protected]>
+
         Improved reproting of kernel return codes.
 
         Reviewed by Anders Carlsson.

Modified: trunk/Source/WebKit2/Platform/unix/EnvironmentUtilities.cpp (103879 => 103880)


--- trunk/Source/WebKit2/Platform/unix/EnvironmentUtilities.cpp	2012-01-01 19:24:00 UTC (rev 103879)
+++ trunk/Source/WebKit2/Platform/unix/EnvironmentUtilities.cpp	2012-01-01 19:44:03 UTC (rev 103880)
@@ -66,7 +66,7 @@
         char* nextColon = strstr(componentStart, ":");
         while (nextColon && nextColon < match) {
             componentStart = nextColon;
-            nextColon = strstr(componentStart, ":");
+            nextColon = strstr(componentStart + 1, ":");
         }
                 
         // Copy over everything right of the match to the current component start, and search from there again.
@@ -97,7 +97,7 @@
         char* nextColon = strstr(componentStart, ":");
         while (nextColon && nextColon < match) {
             componentStart = nextColon;
-            nextColon = strstr(componentStart, ":");
+            nextColon = strstr(componentStart + 1, ":");
         }
         
         // Whether componentStart points to the original string or the last colon, putting the null terminator there will get us the desired result.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to