Closed Bug 1220679 Opened 9 years ago Closed 9 years ago

JSAPI handling in nsContentPermissionProxy::Allow is busted

Categories

(Core :: WebRTC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed
b2g-v2.5 --- fixed

People

(Reporter: bzbarsky, Assigned: schien)

References

Details

Attachments

(1 file)

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)
Not sure if this addresses everything in bug description.
Flags: needinfo?(schien)
Attachment #8682321 - Flags: feedback?(bzbarsky)
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: nobody → schien
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: