[webkit-reviews] review granted: [Bug 57140] Crash from null pointer dereference below WebCore::StorageAreaImpl::setItem() : [Attachment 94469] Proposed fix: NULL-check for page like the rest of the code

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 23 13:31:10 PDT 2011


Darin Adler <darin at apple.com> has granted Julien Chaffraix
<jchaffraix at webkit.org>'s request for review:
Bug 57140: Crash from null pointer dereference below
WebCore::StorageAreaImpl::setItem()
https://bugs.webkit.org/show_bug.cgi?id=57140

Attachment 94469: Proposed fix: NULL-check for page like the rest of the code
https://bugs.webkit.org/attachment.cgi?id=94469&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=94469&action=review

> Source/WebCore/storage/StorageAreaImpl.cpp:106
> -    return frame->page()->settings()->privateBrowsingEnabled();
> +    return frame->page() ?
frame->page()->settings()->privateBrowsingEnabled() : false;

I like writing these with && instead of ? : like this:

    return frame->page() &&
frame->page()->settings()->privateBrowsingEnabled();


More information about the webkit-reviews mailing list