Title: [278873] trunk/Source/WebKit
Revision
278873
Author
you...@apple.com
Date
2021-06-15 07:47:49 -0700 (Tue, 15 Jun 2021)

Log Message

Caches::removeCacheEntry should check for m_storage
https://bugs.webkit.org/show_bug.cgi?id=227022
<rdar://79225216>

Reviewed by Antti Koivisto.

removeCacheEntry can be called asynchronoulsy in Cache::open for badly formatted content.
In that case, given this is done asynchronously, m_storage might be nullified.
Add a nullptr check to cope with this.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::removeCacheEntry):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (278872 => 278873)


--- trunk/Source/WebKit/ChangeLog	2021-06-15 14:14:07 UTC (rev 278872)
+++ trunk/Source/WebKit/ChangeLog	2021-06-15 14:47:49 UTC (rev 278873)
@@ -1,3 +1,18 @@
+2021-06-15  Youenn Fablet  <you...@apple.com>
+
+        Caches::removeCacheEntry should check for m_storage
+        https://bugs.webkit.org/show_bug.cgi?id=227022
+        <rdar://79225216>
+
+        Reviewed by Antti Koivisto.
+
+        removeCacheEntry can be called asynchronoulsy in Cache::open for badly formatted content.
+        In that case, given this is done asynchronously, m_storage might be nullified.
+        Add a nullptr check to cope with this.
+
+        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
+        (WebKit::CacheStorage::Caches::removeCacheEntry):
+
 2021-06-15  Jonathan Bedard  <jbed...@apple.com>
 
         [iOS 15] Support building WebKit

Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (278872 => 278873)


--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2021-06-15 14:14:07 UTC (rev 278872)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2021-06-15 14:47:49 UTC (rev 278873)
@@ -609,7 +609,8 @@
         m_volatileStorage.remove(key);
         return;
     }
-    m_storage->remove(key);
+    if (m_storage)
+        m_storage->remove(key);
 }
 
 void Caches::clearMemoryRepresentation()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to