Closed
Bug 1220679
Opened 9 years ago
Closed 9 years ago
JSAPI handling in nsContentPermissionProxy::Allow is busted
Categories
(Core :: WebRTC, defect)
Core
WebRTC
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: bzbarsky, Assigned: schien)
References
Details
Attachments
(1 file)
(deleted),
patch
|
bzbarsky
:
review+
bzbarsky
:
feedback+
|
Details | Diff | Splinter Review |
It goes like this:
653 mozilla::AutoSafeJSContext cx;
...
658
659 if (!JS_GetProperty(cx, obj, type.BeginReading(), &val) ||
660 !val.isString()) {
But if !JS_GetProperty there is an exception on the safe JS context, and this code just leaves it dangling for some other unsuspecting caller to blow up on. The exception needs to be reported or cleared.
Similar for this bit:
664 if (!choice.init(cx, val)) {
I suggest using an AutoJSAPI instead of AutoSafeJSContext and taking ownership of error reporting on it to handle this issue.
Flags: needinfo?(schien)
Flags: needinfo?(khuey)
Flags: needinfo?(fabrice)
Assignee | ||
Comment 1•9 years ago
|
||
Not sure if this addresses everything in bug description.
Flags: needinfo?(schien)
Attachment #8682321 -
Flags: feedback?(bzbarsky)
Reporter | ||
Comment 2•9 years ago
|
||
Comment on attachment 8682321 [details] [diff] [review]
bug1220679-use-autojsapi-in-permission-prompt.patch
Yep, that looks great. r=me
Flags: needinfo?(khuey)
Flags: needinfo?(fabrice)
Attachment #8682321 -
Flags: review+
Attachment #8682321 -
Flags: feedback?(bzbarsky)
Attachment #8682321 -
Flags: feedback+
Assignee | ||
Comment 3•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → schien
Status: NEW → ASSIGNED
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 4•9 years ago
|
||
Keywords: checkin-needed
Comment 5•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 6•9 years ago
|
||
bugherder uplift |
status-b2g-v2.5:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•