There are consumers of nsContentUtils::GetPrefBranch which don't null-check the result. This is bad, as nsContentUtils::Init explicitly states that a null pref service is allowed. 484de288-23dc-4490-ad28-8eff22110217 is an example of a crash because of this. Consumers requiring fixing: http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsImageFrame.cpp#1904 http://mxr.mozilla.org/mozilla-central/source/dom/base/nsFocusManager.cpp#197
Should the nsFocusManager instance return NS_ERROR_FAILURE or just if(prefBranch) ?
I think a straight |if (prefBranch)| will be fine.
Created attachment 524869 [details] [diff] [review] Patch v1 Thanks. Ideas for who to review?
Assignee: nobody → bmo
Status: NEW → ASSIGNED
Comment on attachment 524869 [details] [diff] [review] Patch v1 I think jst's a good candidate here.
Attachment #524869 - Flags: review?(jst)
And thanks, Ed! http://hg.mozilla.org/mozilla-central/rev/1c62fb90d4dd
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
No worries, thanks for the checkin :-)
Whiteboard: [good first bug]
All instances of: http://mxr.mozilla.org/mozilla-central/search?string=nsContentUtils::GetPrefBranch%28%29 ...null check prefBranch. -> Verified.
Status: RESOLVED → VERIFIED
Crash Signature: [@ nsFocusManager::Init ]
You need to log in before you can comment on or make changes to this bug.