Skip to content

Commit

Permalink
Cherry-pick c0a7c3b. rdar://problem/114003508
Browse files Browse the repository at this point in the history
    Regression(266594@main) Crash under NetworkSession::unregisterNetworkDataTask()
    https://bugs.webkit.org/show_bug.cgi?id=259910
    <rdar://113530127>

    Reviewed by J Pascoe.

    NetworkDataTask::m_session is a WeakPtr and may thus be null by the time the
    NetworkDataTask runs. Null check it before calling `unregisterNetworkDataTask()`
    on it.

    * Source/WebKit/NetworkProcess/NetworkDataTask.cpp:
    (WebKit::NetworkDataTask::~NetworkDataTask):

    Canonical link: https://commits.webkit.org/266690@main

Identifier: 265870.299@safari-7616.1.27.12-branch
  • Loading branch information
cdumez authored and Dan Robson committed Aug 17, 2023
1 parent be537d9 commit 58863a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/WebKit/NetworkProcess/NetworkDataTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ NetworkDataTask::~NetworkDataTask()
ASSERT(RunLoop::isMain());
ASSERT(!m_client);

m_session->unregisterNetworkDataTask(*this);
if (m_session)
m_session->unregisterNetworkDataTask(*this);
}

void NetworkDataTask::scheduleFailure(FailureType type)
Expand Down

0 comments on commit 58863a5

Please sign in to comment.