Bug 166655 - Avoid null dereference when search input is not part of a document
Summary: Avoid null dereference when search input is not part of a document
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-03 11:24 PST by Brent Fulgham
Modified: 2017-01-03 16:09 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2017-01-03 11:24:26 PST
Crash traces indicate that the SearchInputType object can get into a state where the results or cancel buttons are not part of a Document. When this happens, the computedStyle() accessor returns nullptr, which can cause a crash.

This patch protects against accidentally dereferencing the nullptr returned in this case.
Comment 1 Alexey Proskuryakov 2017-01-03 16:09:13 PST
Is it OK for the objects to be in this state? In other words, will the null check convert a crash into a misbehavior, or is it a complete fix?