WebKit Bugzilla
Attachment 340979 Details for
Bug 185867
: [GTK] WebDriver: Network process crash when running imported/w3c/webdriver/tests/delete_cookie/delete.py::test_unknown_cookie
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
wd-network-process-crash.diff (text/plain), 4.03 KB, created by
Carlos Garcia Campos
on 2018-05-22 06:28:00 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2018-05-22 06:28:00 PDT
Size:
4.03 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e5f6f8ffe14..f7b12e08874 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-05-22 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [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 NOBODY (OOPS!). >+ >+ 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): >+ > 2018-05-21 Yusuke Suzuki <utatane.tea@gmail.com> > > Use more C++17 >diff --git a/Source/WebCore/platform/network/soup/CookieJarSoup.cpp b/Source/WebCore/platform/network/soup/CookieJarSoup.cpp >index 9c0912e6b49..f49409a7f3b 100644 >--- a/Source/WebCore/platform/network/soup/CookieJarSoup.cpp >+++ b/Source/WebCore/platform/network/soup/CookieJarSoup.cpp >@@ -55,12 +55,16 @@ void setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstPar > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); >- SoupCookieJar* jar = session.cookieStorage(); >- > GUniquePtr<SoupURI> origin = url.createSoupURI(); >+ if (!origin) >+ return; >+ > GUniquePtr<SoupURI> firstPartyURI = firstParty.createSoupURI(); >+ if (!firstPartyURI) >+ return; > > // Get existing cookies for this origin. >+ SoupCookieJar* jar = session.cookieStorage(); > GSList* existingCookies = soup_cookie_jar_get_cookie_list(jar, origin.get(), TRUE); > > Vector<String> cookies; >@@ -88,6 +92,9 @@ void setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstPar > static std::pair<String, bool> cookiesForSession(const NetworkStorageSession& session, const URL& url, bool forHTTPHeader, IncludeSecureCookies includeSecureCookies) > { > GUniquePtr<SoupURI> uri = url.createSoupURI(); >+ if (!uri) >+ return { { }, false }; >+ > GSList* cookies = soup_cookie_jar_get_cookie_list(session.cookieStorage(), uri.get(), forHTTPHeader); > bool didAccessSecureCookies = false; > >@@ -154,6 +161,9 @@ bool getRawCookies(const NetworkStorageSession& session, const URL& firstParty, > UNUSED_PARAM(pageID); > rawCookies.clear(); > GUniquePtr<SoupURI> uri = url.createSoupURI(); >+ if (!uri) >+ return false; >+ > GUniquePtr<GSList> cookies(soup_cookie_jar_get_cookie_list(session.cookieStorage(), uri.get(), TRUE)); > if (!cookies) > return false; >@@ -179,9 +189,11 @@ bool getRawCookies(const NetworkStorageSession& session, const URL& firstParty, > > void deleteCookie(const NetworkStorageSession& session, const URL& url, const String& name) > { >- SoupCookieJar* jar = session.cookieStorage(); >- > GUniquePtr<SoupURI> uri = url.createSoupURI(); >+ if (!uri) >+ return; >+ >+ SoupCookieJar* jar = session.cookieStorage(); > GUniquePtr<GSList> cookies(soup_cookie_jar_get_cookie_list(jar, uri.get(), TRUE)); > if (!cookies) > return; >diff --git a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >index 411b9cd4a6b..341fafecad0 100644 >--- a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >+++ b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp >@@ -318,6 +318,9 @@ Vector<Cookie> NetworkStorageSession::getCookies(const URL& url) > { > Vector<Cookie> cookies; > GUniquePtr<SoupURI> uri = url.createSoupURI(); >+ if (!uri) >+ return cookies; >+ > GUniquePtr<GSList> cookiesList(soup_cookie_jar_get_cookie_list(cookieStorage(), uri.get(), TRUE)); > for (GSList* item = cookiesList.get(); item; item = g_slist_next(item)) { > GUniquePtr<SoupCookie> soupCookie(static_cast<SoupCookie*>(item->data));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mcatanzaro
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185867
: 340979