Closed Bug 414749 Opened 18 years ago Closed 17 years ago

nsJSUtils::GetCallingLocation doesn't deal with null principals well

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta4

People

(Reporter: mrbkap, Assigned: mrbkap)

Details

(Keywords: verified1.8.1.13, Whiteboard: fixed on branch by 411092)

Attachments

(1 file)

In bug 411092, I added some code that assumed that all scripts have principals. In theory, that's nice, but in practice, event handlers (such as <body onload>) do not have principals. This was causing the test boxes to go orange. I checked in a null check to avoid the crash and the null check is correct for the common case, but I worry that it might not always be correct.
Version: unspecified → Trunk
Attached patch Proposed fixSplinter Review
This patch makes us use the callee object if there are no principals in the script. I think that we want to use the script principals over the callee because the filename will be privileged even if the callee has been cloned into an untrusted context. jst, if you agree, could you approve this as well?
Assignee: nobody → mrbkap
Status: NEW → ASSIGNED
Attachment #300245 - Flags: superreview?(jst)
Attachment #300245 - Flags: review?(jst)
Attachment #300245 - Flags: superreview?(jst)
Attachment #300245 - Flags: superreview+
Attachment #300245 - Flags: review?(jst)
Attachment #300245 - Flags: review+
Attachment #300245 - Flags: approval1.9?
Attachment #300245 - Flags: approval1.9? → approval1.9+
Flags: blocking1.9+
Target Milestone: --- → mozilla1.9beta4
Blake, do you want me to land this one for you?
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: blocking1.8.1.13+
Whiteboard: fixed on branch by 411092
branch version of 411092 checked in.
Keywords: fixed1.8.1.13
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: