Title: [280623] trunk/Source/WebCore
Revision
280623
Author
[email protected]
Date
2021-08-03 17:02:49 -0700 (Tue, 03 Aug 2021)

Log Message

Null check self.session after calling _cancel instead of before
https://bugs.webkit.org/show_bug.cgi?id=228757
<rdar://79224868>

Patch by Alex Christensen <[email protected]> on 2021-08-03
Reviewed by Geoffrey Garen.

_cancel already null checks self.session before using it.
It seems to be setting self.session to null after the null check, so move the null check to before we use it.
This should fix an occasional crash during teardown.

* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask _restart]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (280622 => 280623)


--- trunk/Source/WebCore/ChangeLog	2021-08-03 23:40:10 UTC (rev 280622)
+++ trunk/Source/WebCore/ChangeLog	2021-08-04 00:02:49 UTC (rev 280623)
@@ -1,3 +1,18 @@
+2021-08-03  Alex Christensen  <[email protected]>
+
+        Null check self.session after calling _cancel instead of before
+        https://bugs.webkit.org/show_bug.cgi?id=228757
+        <rdar://79224868>
+
+        Reviewed by Geoffrey Garen.
+
+        _cancel already null checks self.session before using it.
+        It seems to be setting self.session to null after the null check, so move the null check to before we use it.
+        This should fix an occasional crash during teardown.
+
+        * platform/network/cocoa/WebCoreNSURLSession.mm:
+        (-[WebCoreNSURLSessionDataTask _restart]):
+
 2021-08-03  Kimmo Kinnunen  <[email protected]>
 
         Crash while reading WebGL drawing buffer if canvas image buffer allocation fails

Modified: trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm (280622 => 280623)


--- trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2021-08-03 23:40:10 UTC (rev 280622)
+++ trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2021-08-04 00:02:49 UTC (rev 280623)
@@ -717,11 +717,11 @@
 {
     ASSERT(isMainThread());
 
+    [self _cancel];
+
     if (!self.session)
         return;
 
-    [self _cancel];
-
     if ([self.session rangeResponseGenerator].willHandleRequest(self, self.originalRequest))
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to