Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Null dereference in PDFPlugin::snapshot()
https://bugs.webkit.org/show_bug.cgi?id=217668 Patch by Julian Gonzalez <julian_a_gonzalez@apple.com> on 2020-10-13 Reviewed by Ryosuke Niwa. Source/WebKit: Add a null pointer check in PDFPlugin's snapshot method to prevent a crash if the backing store's size isn't sufficient for the ShareableBitmap. Test: plugins/pdf-plugin-null-onloaddeddata.html * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::snapshot): LayoutTests: Add new pass-if-no-crash test to catch crash in PDFPlugin snapshotting. * plugins/pdf-plugin-null-onloaddeddata-expected.txt: Added. * plugins/pdf-plugin-null-onloaddeddata.html: Added. Canonical link: https://commits.webkit.org/230427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
d078e28
commit 51a7ebc
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
4 changes: 4 additions & 0 deletions
4
LayoutTests/plugins/pdf-plugin-null-onloaddeddata-expected.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This tests determining the PDF plugin does not crash upon a null onloadeddata variable. | ||
|
||
PASS | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<style> | ||
embed, body { zoom: 61; } | ||
</style> | ||
</head> | ||
<body onload=pdfonload()> | ||
<p>This tests determining the PDF plugin does not crash upon a null onloadeddata variable.</p> | ||
<div id="result">FAIL</div> | ||
<embed id="testPlugin" type="application/pdf"></embed> | ||
<script> | ||
function pdfonload() { | ||
testPlugin.onloadeddata = null; | ||
|
||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
|
||
result.textContent = 'PASS'; | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains 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
This file contains 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