Summary: | Protect m_data when iterating in CachedRawResource::didAddClient | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||||
Component: | New Bugs | Assignee: | Alex Christensen <achristensen> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, ews-watchlist, japhet, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=230121 | ||||||||
Attachments: |
|
Description
Alex Christensen
2021-07-20 09:03:45 PDT
Created attachment 433876 [details]
Patch
Comment on attachment 433876 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433876&action=review r=me with optional nit fixes. > Source/WebCore/loader/cache/CachedRawResource.cpp:170 > if (m_data) { We could also just do: if (auto data = m_data) { and use data below instead of m_data. > Source/WebCore/loader/cache/CachedRawResource.cpp:171 > + auto protectedData = RefPtr { m_data }; instead of adding the protector here. > Source/WebCore/loader/cache/CachedRawResource.cpp:173 > + if (!hasClient(*client)) Better safe than sorry indeed. I know we like early return in WebKit, but when it's one line life this, I don't feel like it's great. Created attachment 433877 [details]
Patch
Committed r280083 (239808@main): <https://commits.webkit.org/239808@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433877 [details]. Sadly, it seems this didn't do the trick :( <rdar://82936913> |