Summary: | [GTK] Missing nullchecks in GTK's a11y wrapper | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mario Sanchez Prada <mario> | ||||
Component: | Accessibility | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | mrobinson | ||||
Priority: | P2 | Keywords: | Gtk | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Attachments: |
|
Description
Mario Sanchez Prada
2011-04-13 04:13:26 PDT
Created attachment 89363 [details]
Patch proposal
Attached patch proposal.
No need to attach a test since it's just about adding some extra nullchecks to avoid potential problems. Other than that, it keeps passing all API and Layout tests up to date.
Comment on attachment 89363 [details] Patch proposal View in context: https://bugs.webkit.org/attachment.cgi?id=89363&action=review Looks good, but consider my comments before landing. > Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:1560 > + Document* document = coreObject->document(); > switch(coords) { > case ATK_XY_SCREEN: > - extents = coreObject->document()->view()->contentsToScreen(extents); > + if (document) > + extents = document->view()->contentsToScreen(extents); > break; If you only use "document" in this if block you should probably do: if (Document* document = coreObject->document()) extents = document->view()->contentsToScreen(extents); and remove the first declaration. > Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:1836 > + Document* document = coreObject->document(); > + if (!document) > + return; > + > + if (!document->frame()) > return; Can't this just be: if (!document || !document->frame()) return; > Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:1867 > + Document* document = coreObject->document(); > + if (!document) > return; > + > + if (!document->frame()) > + return; > + Ditto. Committed r83746: <http://trac.webkit.org/changeset/83746> |