RESOLVED FIXED Bug 228108
Protect m_data when iterating in CachedRawResource::didAddClient
https://bugs.webkit.org/show_bug.cgi?id=228108
Summary Protect m_data when iterating in CachedRawResource::didAddClient
Alex Christensen
Reported 2021-07-20 09:03:45 PDT
Protect m_data when iterating in CachedRawResource::didAddClient
Attachments
Patch (1.79 KB, patch)
2021-07-20 09:06 PDT, Alex Christensen
no flags
Patch (2.01 KB, patch)
2021-07-20 09:18 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2021-07-20 09:06:30 PDT
Alex Christensen
Comment 2 2021-07-20 09:06:33 PDT
Chris Dumez
Comment 3 2021-07-20 09:12:08 PDT
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.
Alex Christensen
Comment 4 2021-07-20 09:18:58 PDT
EWS
Comment 5 2021-07-20 09:55:05 PDT
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].
Chris Dumez
Comment 6 2021-09-09 13:10:06 PDT
Sadly, it seems this didn't do the trick :( <rdar://82936913>
Note You need to log in before you can comment on or make changes to this bug.