Closed Bug 377045 Opened 19 years ago Closed 19 years ago

Crash in nsDocAccessible::GetParent()

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

Details

(Keywords: access, crash)

Attachments

(1 file)

Missing null pointer check.
Attached patch Null checksSplinter Review
Attachment #261157 - Flags: review?(surkov.alexander)
Comment on attachment 261157 [details] [diff] [review] Null checks >Index: accessible/src/base/nsDocAccessible.cpp >=================================================================== >RCS file: /cvsroot/mozilla/accessible/src/base/nsDocAccessible.cpp,v >retrieving revision 1.132 >diff -p -u -5 -r1.132 nsDocAccessible.cpp >--- accessible/src/base/nsDocAccessible.cpp 10 Apr 2007 16:28:38 -0000 1.132 >+++ accessible/src/base/nsDocAccessible.cpp 10 Apr 2007 17:26:35 -0000 >@@ -439,25 +439,26 @@ NS_IMETHODIMP nsDocAccessible::CacheAcce > > NS_IMETHODIMP nsDocAccessible::GetParent(nsIAccessible **aParent) > { > // Hook up our new accessible with our parent > if (!mParent) { >+ *aParent = nsnull; >+ NS_ENSURE_TRUE(mDocument, NS_ERROR_FAILURE); Probably you should move these lines on top of the method. I think doc accessible cannot have parent without mDocument.
Attachment #261157 - Flags: review?(surkov.alexander) → review+
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: