Title: [224089] trunk/Source/WebDriver
Revision
224089
Author
[email protected]
Date
2017-10-27 00:11:56 -0700 (Fri, 27 Oct 2017)

Log Message

WebDriver: deserializeTimeouts should fail if the value is not integer
https://bugs.webkit.org/show_bug.cgi?id=178866

Reviewed by Brian Burg.

If value is not an integer, or it is less than 0 or greater than 2^64 – 1, return error with error code invalid
argument.
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-deserialize-as-a-timeout

Fixes: imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_values[timeouts-value59-body0]
       imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_values[timeouts-value59-body1]

* WebDriverService.cpp:
(WebDriver::deserializeTimeouts):

Modified Paths

Diff

Modified: trunk/Source/WebDriver/ChangeLog (224088 => 224089)


--- trunk/Source/WebDriver/ChangeLog	2017-10-27 07:10:55 UTC (rev 224088)
+++ trunk/Source/WebDriver/ChangeLog	2017-10-27 07:11:56 UTC (rev 224089)
@@ -1,5 +1,22 @@
 2017-10-27  Carlos Garcia Campos  <[email protected]>
 
+        WebDriver: deserializeTimeouts should fail if the value is not integer
+        https://bugs.webkit.org/show_bug.cgi?id=178866
+
+        Reviewed by Brian Burg.
+
+        If value is not an integer, or it is less than 0 or greater than 2^64 – 1, return error with error code invalid
+        argument.
+        https://w3c.github.io/webdriver/webdriver-spec.html#dfn-deserialize-as-a-timeout
+
+        Fixes: imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_values[timeouts-value59-body0]
+               imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_values[timeouts-value59-body1]
+
+        * WebDriverService.cpp:
+        (WebDriver::deserializeTimeouts):
+
+2017-10-27  Carlos Garcia Campos  <[email protected]>
+
         WebDriver: failing to process capabilities should produce InvalidArgument error not SessionNotCreated
         https://bugs.webkit.org/show_bug.cgi?id=178864
 

Modified: trunk/Source/WebDriver/WebDriverService.cpp (224088 => 224089)


--- trunk/Source/WebDriver/WebDriverService.cpp	2017-10-27 07:10:55 UTC (rev 224088)
+++ trunk/Source/WebDriver/WebDriverService.cpp	2017-10-27 07:11:56 UTC (rev 224089)
@@ -283,7 +283,7 @@
             continue;
 
         int timeoutMS;
-        if (!it->value->asInteger(timeoutMS) || timeoutMS < 0 || timeoutMS > INT_MAX)
+        if (it->value->type() != InspectorValue::Type::Integer || !it->value->asInteger(timeoutMS) || timeoutMS < 0 || timeoutMS > INT_MAX)
             return std::nullopt;
 
         if (it->key == "script")
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to