Closed Bug 665012 Opened 9 years ago Closed 9 years ago

Do not assume GetCurrentPrincipal() == nsnull means system principal, in nsDOMDataTransfer.cpp

Categories

(Core :: Security, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla7

People

(Reporter: mounir, Assigned: mounir)

References

Details

(Whiteboard: [sg:audit])

Attachments

(1 file)

Follow-up from bug 658037.
I will work on that unless someone wants to steal.
Assignee: nobody → mounir.lamouri
Attached patch Patch v1Splinter Review
I've added a |nsresult& rv| method instead of the usual |nsresult* rv|. I don't see any advantage of using a pointer instead of a reference but only disadvantages. I believe I should use a pointer given that it's used everywhere but I might know why ;)
Attachment #540070 - Flags: review?(bzbarsky)
Whiteboard: [needs review]
Status: NEW → ASSIGNED
Comment on attachment 540070 [details] [diff] [review]
Patch v1

>-  NS_ENSURE_SUCCESS(rv, rv)
>+  NS_ENSURE_SUCCESS(rv, rv);

I assume this belongs in some other patch?

The reason to use a pointer is that it makes it clearer at the callsite that an out param is being used (as opposed to in param).

r=me modulo those issues.
Attachment #540070 - Flags: review?(bzbarsky) → review+
(In reply to comment #3)
> The reason to use a pointer is that it makes it clearer at the callsite that
> an out param is being used (as opposed to in param).
> 
> r=me modulo those issues.

I believe in "those issues" you include making rv a pointer instead of a reference?
Pushed:
http://hg.mozilla.org/mozilla-central/rev/f6d7d57e7747
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [needs review]
Target Milestone: --- → mozilla7
Whiteboard: [sg:audit]
Group: core-security
You need to log in before you can comment on or make changes to this bug.