Template crashes with javascript nsIXULTemplateResult implementation

RESOLVED FIXED

Status

()

Core
XUL
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: Pawel Chmielowski, Assigned: Pawel Chmielowski)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

v3
2.93 KB, patch
Pawel Chmielowski
: review+
Pawel Chmielowski
: superreview+
Details | Diff | Splinter Review
(Assignee)

Description

12 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060715 Firefox/3.0a1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060715 Firefox/3.0a1

Template code cast objects from nsISimpleEnumerator instead calling QI on its. This causes crashes when used with XPConnect wrappers.

Reproducible: Always
(Assignee)

Comment 1

12 years ago
Created attachment 229487 [details] [diff] [review]
v1

This patch fixes this problem for me.
Attachment #229487 - Flags: review?(enndeakin)

Comment 2

12 years ago
Comment on attachment 229487 [details] [diff] [review]
v1

OK, but please also change the similar call in nsXULTreeBuilder::OpenSubtreeForQuerySet
Attachment #229487 - Flags: review?(enndeakin) → review+
(Assignee)

Comment 3

12 years ago
Created attachment 229501 [details] [diff] [review]
v2

This adds similar change to nsXULTreeBuilder::OpenSubtreeForQuerySet
Attachment #229487 - Attachment is obsolete: true
Attachment #229501 - Flags: review+
(Assignee)

Updated

12 years ago
Attachment #229501 - Flags: superreview?(bzbarsky)
Comment on attachment 229501 [details] [diff] [review]
v2

>Index: content/xul/templates/src/nsXULContentBuilder.cpp
>+        nsCOMPtr<nsIXULTemplateResult> nextresult = do_QueryInterface(nr, &rv);

Why bother with rv if you don't use it?

Same in the other spot.

sr=bzbarsky with that fixed.

Please let me know if you need this checked in, ok?
Attachment #229501 - Flags: superreview?(bzbarsky) → superreview+
Assignee: jag → prefiks
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 5

12 years ago
Created attachment 229506 [details] [diff] [review]
v3

Review comment fixes.

I will very appreciate if you could check it in.
Attachment #229501 - Attachment is obsolete: true
Attachment #229506 - Flags: superreview+
Attachment #229506 - Flags: review+
Checked in.  Thanks for the fix!
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED

Comment 7

12 years ago
Why does class nsGetterAddRefs<T> have an nsISupports**() operator anyway?
Good question!  Worth filing a bug on XPCOM over, maybe (and ccing dbaron and biesi).
You need to log in before you can comment on or make changes to this bug.