Changeset 232066 in webkit


Ignore:
Timestamp:
May 22, 2018 8:09:57 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] WebDriver: Network process crash when running imported/w3c/webdriver/tests/delete_cookie/delete.py::test_unknown_cookie
https://bugs.webkit.org/show_bug.cgi?id=185867

Reviewed by Michael Catanzaro.

We need to null check the value returned by URL::createSoupURI() before passing it to soup.

  • platform/network/soup/CookieJarSoup.cpp:

(WebCore::setCookiesFromDOM):
(WebCore::cookiesForSession):
(WebCore::getRawCookies):
(WebCore::deleteCookie):

  • platform/network/soup/NetworkStorageSessionSoup.cpp:

(WebCore::NetworkStorageSession::getCookies):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r232065 r232066  
     12018-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] WebDriver: Network process crash when running imported/w3c/webdriver/tests/delete_cookie/delete.py::test_unknown_cookie
     4        https://bugs.webkit.org/show_bug.cgi?id=185867
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        We need to null check the value returned by URL::createSoupURI() before passing it to soup.
     9
     10        * platform/network/soup/CookieJarSoup.cpp:
     11        (WebCore::setCookiesFromDOM):
     12        (WebCore::cookiesForSession):
     13        (WebCore::getRawCookies):
     14        (WebCore::deleteCookie):
     15        * platform/network/soup/NetworkStorageSessionSoup.cpp:
     16        (WebCore::NetworkStorageSession::getCookies):
     17
    1182018-05-22  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/platform/network/soup/CookieJarSoup.cpp

    r231859 r232066  
    5656    UNUSED_PARAM(frameID);
    5757    UNUSED_PARAM(pageID);
     58    GUniquePtr<SoupURI> origin = url.createSoupURI();
     59    if (!origin)
     60        return;
     61
     62    GUniquePtr<SoupURI> firstPartyURI = firstParty.createSoupURI();
     63    if (!firstPartyURI)
     64        return;
     65
     66    // Get existing cookies for this origin.
    5867    SoupCookieJar* jar = session.cookieStorage();
    59 
    60     GUniquePtr<SoupURI> origin = url.createSoupURI();
    61     GUniquePtr<SoupURI> firstPartyURI = firstParty.createSoupURI();
    62 
    63     // Get existing cookies for this origin.
    6468    GSList* existingCookies = soup_cookie_jar_get_cookie_list(jar, origin.get(), TRUE);
    6569
     
    8993{
    9094    GUniquePtr<SoupURI> uri = url.createSoupURI();
     95    if (!uri)
     96        return { { }, false };
     97
    9198    GSList* cookies = soup_cookie_jar_get_cookie_list(session.cookieStorage(), uri.get(), forHTTPHeader);
    9299    bool didAccessSecureCookies = false;
     
    155162    rawCookies.clear();
    156163    GUniquePtr<SoupURI> uri = url.createSoupURI();
     164    if (!uri)
     165        return false;
     166
    157167    GUniquePtr<GSList> cookies(soup_cookie_jar_get_cookie_list(session.cookieStorage(), uri.get(), TRUE));
    158168    if (!cookies)
     
    180190void deleteCookie(const NetworkStorageSession& session, const URL& url, const String& name)
    181191{
     192    GUniquePtr<SoupURI> uri = url.createSoupURI();
     193    if (!uri)
     194        return;
     195
    182196    SoupCookieJar* jar = session.cookieStorage();
    183 
    184     GUniquePtr<SoupURI> uri = url.createSoupURI();
    185197    GUniquePtr<GSList> cookies(soup_cookie_jar_get_cookie_list(jar, uri.get(), TRUE));
    186198    if (!cookies)
  • trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp

    r230358 r232066  
    319319    Vector<Cookie> cookies;
    320320    GUniquePtr<SoupURI> uri = url.createSoupURI();
     321    if (!uri)
     322        return cookies;
     323
    321324    GUniquePtr<GSList> cookiesList(soup_cookie_jar_get_cookie_list(cookieStorage(), uri.get(), TRUE));
    322325    for (GSList* item = cookiesList.get(); item; item = g_slist_next(item)) {
Note: See TracChangeset for help on using the changeset viewer.