-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Null pointer dereference in LegacyWebArchive::protectedMainResource() #53505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
webkit-commit-queue
merged 1 commit into
WebKit:main
from
szewai:eng/Null-pointer-dereference-in-LegacyWebArchive-protectedMainResource
Nov 7, 2025
Merged
Null pointer dereference in LegacyWebArchive::protectedMainResource() #53505
webkit-commit-queue
merged 1 commit into
WebKit:main
from
szewai:eng/Null-pointer-dereference-in-LegacyWebArchive-protectedMainResource
Nov 7, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
|
EWS run on previous version of this PR (hash eae6715) Details |
annevk
approved these changes
Nov 6, 2025
| addSubframeArchive(WTFMove(subframeArchive)); | ||
| else | ||
| LOG(Archives, "LegacyWebArchive - Invalid subframe archive skipped"); | ||
| if (auto subFrameArchive = create(subframeDict)) |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
| if (auto subFrameArchive = create(subframeDict)) | |
| if (Ref subFrameArchive = create(subframeDict)) |
rniwa
approved these changes
Nov 6, 2025
eae6715 to
ebd2137
Compare
Collaborator
|
EWS run on current version of this PR (hash ebd2137) Details |
https://bugs.webkit.org/show_bug.cgi?id=302063 rdar://164088405 Reviewed by Ryosuke Niwa and Anne van Kesteren. Archive::mainResource() can return nullptr and LegacyWebArchive::protectedMainResource() currently defererences it without null check, so we are seeing crashes. However, LegacyWebArchive should not be created with null main resource, as it cannot be loaded anyways. So instead of adding null check in protectedMainResource(), this patch fixes the crash by ensuring LegacyWebArchive is always created non-null main resource: LegacyWebArchive::create*() functions now returns nullptr instead of default LegacyWebArchive object on error. * Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::create): (WebCore::LegacyWebArchive::createInternal): (WebCore::LegacyWebArchive::extract): Deleted. * Source/WebCore/loader/archive/cf/LegacyWebArchive.h: * Source/WebKitLegacy/mac/WebView/WebArchive.mm: (-[WebArchivePrivate init]): Canonical link: https://commits.webkit.org/302691@main
ebd2137 to
581d4c4
Compare
Collaborator
|
Committed 302691@main (581d4c4): https://commits.webkit.org/302691@main Reviewed commits have been landed. Closing PR #53505 and removing active labels. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
New Bugs
Unclassified bugs are placed in this component until the correct component can be determined.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🛠 mac-apple
581d4c4
ebd2137
🧪 win-tests