Summary: | Avoid null pointer dereference when creating ImageBitmap from a null image | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | John Cunningham <johncunningham> | ||||||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | cdumez, changseok, esprehn+autocc, ews-watchlist, gyuyoung.kim, heycam, ryan.hamley, sabouhallawa, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
John Cunningham
2021-10-14 21:40:02 PDT
Created attachment 441331 [details]
Patch
Comment on attachment 441331 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=441331&action=review Non-reviewer r=me. > Source/WebCore/ChangeLog:3 > + Reject createImageBitmap request earlier if the image is null. Also, fix a null ptr deref by checking that the native image is nonnull when requesting the colorspace, otherwise, return a default of SRGB. Nit: Two sentences is a bit long for this line. :-) I would mention the more important fix here like "Avoid null pointer dereference when creating ImageBitmap from a null image", and then put the details about defaulting to sRGB and rejecting the promise earlier below, just below the "Reviewed by" line. Comment on attachment 441331 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=441331&action=review r=me based on Cameron's review. >> Source/WebCore/ChangeLog:3 >> + Reject createImageBitmap request earlier if the image is null. Also, fix a null ptr deref by checking that the native image is nonnull when requesting the colorspace, otherwise, return a default of SRGB. > > Nit: Two sentences is a bit long for this line. :-) I would mention the more important fix here like "Avoid null pointer dereference when creating ImageBitmap from a null image", and then put the details about defaulting to sRGB and rejecting the promise earlier below, just below the "Reviewed by" line. Yes please change it to the shorter description. > Source/WebCore/ChangeLog:9 > + No new tests (OOPS!). This line should be removed before committing. It will be great if we can get a layout test though. Created attachment 441838 [details]
Patch
Created attachment 441840 [details]
Patch
Committed r284522 (243265@main): <https://commits.webkit.org/243265@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 441840 [details]. *** Bug 236622 has been marked as a duplicate of this bug. *** |