Changeset 224089 in webkit


Ignore:
Timestamp:
Oct 27, 2017 12:11:56 AM (6 years ago)
Author:
Carlos Garcia Campos
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 264 – 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):

Location:
trunk/Source/WebDriver
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebDriver/ChangeLog

    r224088 r224089  
     12017-10-27  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        WebDriver: deserializeTimeouts should fail if the value is not integer
     4        https://bugs.webkit.org/show_bug.cgi?id=178866
     5
     6        Reviewed by Brian Burg.
     7
     8        If value is not an integer, or it is less than 0 or greater than 2^64 – 1, return error with error code invalid
     9        argument.
     10        https://w3c.github.io/webdriver/webdriver-spec.html#dfn-deserialize-as-a-timeout
     11
     12        Fixes: imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_values[timeouts-value59-body0]
     13               imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_values[timeouts-value59-body1]
     14
     15        * WebDriverService.cpp:
     16        (WebDriver::deserializeTimeouts):
     17
    1182017-10-27  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebDriver/WebDriverService.cpp

    r224088 r224089  
    284284
    285285        int timeoutMS;
    286         if (!it->value->asInteger(timeoutMS) || timeoutMS < 0 || timeoutMS > INT_MAX)
     286        if (it->value->type() != InspectorValue::Type::Integer || !it->value->asInteger(timeoutMS) || timeoutMS < 0 || timeoutMS > INT_MAX)
    287287            return std::nullopt;
    288288
Note: See TracChangeset for help on using the changeset viewer.