Skip to content

Commit

Permalink
Add null check in NetworkStateNotifier::updateStateWithoutNotifying
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=259163
rdar://111926368

Reviewed by Brent Fulgham.

Crash logs indicate m_store can be null and it crashes when it is.
In NetworkStateNotifier::startObserving we early return if it's null.
This adds another early return.

* Source/WebCore/platform/network/mac/NetworkStateNotifierMac.cpp:
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying):

Canonical link: https://commits.webkit.org/266011@main
  • Loading branch information
achristensen07 committed Jul 12, 2023
1 parent 00e61ef commit 302c4c5
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ namespace WebCore {

void NetworkStateNotifier::updateStateWithoutNotifying()
{
if (!m_store)
return;

auto key = adoptCF(SCDynamicStoreKeyCreateNetworkInterface(0, kSCDynamicStoreDomainState));
auto propertyList = dynamic_cf_cast<CFDictionaryRef>(adoptCF(SCDynamicStoreCopyValue(m_store.get(), key.get())));
if (!propertyList)
Expand Down

0 comments on commit 302c4c5

Please sign in to comment.