Bug 62666 - Callers should be robust against WebImage::create() returning an image with a null snapshot
Summary: Callers should be robust against WebImage::create() returning an image with a...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: John Sullivan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-06-14 15:04 PDT by John Sullivan
Modified: 2011-06-14 22:29 PDT (History)
2 users (show)

See Also:


Attachments
Patch that makes the callers of WebImage check for a null bitmap before dereferencing the bitmap (3.61 KB, patch)
2011-06-14 15:13 PDT, John Sullivan
no flags Details | Formatted Diff | Diff
Patch (3.30 KB, patch)
2011-06-14 19:41 PDT, Sam Weinig
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Sullivan 2011-06-14 15:04:35 PDT
We’ve seen some crashes caused by dereferencing a WebImage->bitmap(); the callers are assuming that WebImage->bitmap() will never return null, but it can return null in at least some cases where it can’t allocate enough memory. We should make the callers robust by having them check for null.

In Radar as <rdar://problem/9606676>
Comment 1 John Sullivan 2011-06-14 15:13:08 PDT
Created attachment 97169 [details]
Patch that makes the callers of WebImage check for a null bitmap before dereferencing the bitmap
Comment 2 mitz 2011-06-14 15:15:53 PDT
Assuming a change log
Comment 3 John Sullivan 2011-06-14 15:17:28 PDT
I forgot to add the ChangeLog before uploading the patch, but I will commit it along with the patch.
Comment 4 John Sullivan 2011-06-14 15:18:38 PDT
Fixed in http://trac.webkit.org/changeset/88856
Comment 5 Sam Weinig 2011-06-14 18:53:49 PDT
This patch wasn't quite right. We shouldn't be null checking arguments to API functions.  I will post a follow up patch in a moment.
Comment 6 Sam Weinig 2011-06-14 19:41:52 PDT
Created attachment 97222 [details]
Patch
Comment 7 Sam Weinig 2011-06-14 22:29:13 PDT
Committed r88906: <http://trac.webkit.org/changeset/88906>