Bug 104961 - Add a missing nullity check in RenderObject::containingBlock
Summary: Add a missing nullity check in RenderObject::containingBlock
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: vollick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-13 14:52 PST by vollick
Modified: 2012-12-13 19:33 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.52 KB, patch)
2012-12-13 14:54 PST, vollick
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vollick 2012-12-13 14:52:42 PST
At one point we assert that !o->isAnonymousBlock(), but it's quite possible that o is null.
Comment 1 vollick 2012-12-13 14:54:04 PST
Created attachment 179347 [details]
Patch
Comment 2 Adrienne Walker 2012-12-13 14:59:18 PST
Comment on attachment 179347 [details]
Patch

R=me.  That looks safe.  Later in the function there's a similar !o || !o->foo() assert.
Comment 3 WebKit Review Bot 2012-12-13 15:53:36 PST
Comment on attachment 179347 [details]
Patch

Clearing flags on attachment: 179347

Committed r137674: <http://trac.webkit.org/changeset/137674>
Comment 4 WebKit Review Bot 2012-12-13 15:53:39 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Alexey Proskuryakov 2012-12-13 18:19:18 PST
Why didn't this patch have a regression test? It's not OK to ignore those for fixes made through code inspection (I'd say that it's even more important for those fixes).
Comment 6 vollick 2012-12-13 19:33:37 PST
(In reply to comment #5)
> Why didn't this patch have a regression test? It's not OK to ignore those for fixes made through code inspection (I'd say that it's even more important for those fixes).

This patch was not initiated by code inspection, it was made to fix a debug-only crash in a layout test http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=fullscreen%2Ffull-screen-fixed-pos-parent.html%2Cfullscreen%2Ffull-screen-iframe-without-allow-attribute-allowed-from-parent.html

The crash resulted from asking a valid RenderObject what its containing block was -- something that, I believe, shouldn't run you the risk of crashing -- and appeared to be an oversight when the assertion was written.