Closed
Bug 1273128
Opened 9 years ago
Closed 9 years ago
[Static Analysis][Dereference before null check] In function nsMenuBarListener::KeyPress
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla49
| Tracking | Status | |
|---|---|---|
| firefox49 | --- | fixed |
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1361780)
Attachments
(1 file)
The Static Analysis tool Coverity added that variable |nativeKeyEvent| is derefernced before being null checked.
dereference:
>> // If accesskey handling was forwarded to a child process, wait for
>> // the mozaccesskeynotfound event before handling accesskeys.
>> WidgetKeyboardEvent* nativeKeyEvent =
>> aKeyEvent->WidgetEventPtr()->AsKeyboardEvent();
>> if (nativeKeyEvent->mAccessKeyForwardedToChild) {
>> return NS_OK;
>> }
null-check:
>> bool hasAccessKeyCandidates = charCode != 0;
>> if (!hasAccessKeyCandidates) {
>> if (nativeKeyEvent) {
>> AutoTArray<uint32_t, 10> keys;
>> nativeKeyEvent->GetAccessKeyCandidates(keys);
>> hasAccessKeyCandidates = !keys.IsEmpty();
>> }
>> }
| Assignee | ||
Comment 1•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/52804/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52804/
Attachment #8752817 -
Flags: review?(jvarga)
Comment 2•9 years ago
|
||
Comment on attachment 8752817 [details]
MozReview Request: Bug 1273128 - prevent null pointer dereference on |nativeKeyEvent|. r?janv
https://reviewboard.mozilla.org/r/52804/#review51428
r=me
Attachment #8752817 -
Flags: review?(jvarga) → review+
Comment 4•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Updated•7 years ago
|
Component: XP Toolkit/Widgets: Menus → XUL
You need to log in
before you can comment on or make changes to this bug.
Description
•