Remove dangerous public destructor of nsFilteredContentIterator

RESOLVED FIXED in mozilla33

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bjacob, Assigned: mccr8)

Tracking

Other Branch
mozilla33
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

In bug 1028588 we removed dangerous public destructors of XPCOM-refcounted classes outside of a finite whitelist, see HasDangerousPublicDestructor. Now we are going over the entries in this whitelist.

One of them is: nsFilteredContentIterator
(Assignee)

Updated

4 years ago
Assignee: nobody → continuation
(Assignee)

Comment 1

4 years ago
The code in nsTextServicesDocument::CreateContentIterator really doesn't trust null checks.
(Assignee)

Comment 2

4 years ago
1991   nsFilteredContentIterator* filter = new nsFilteredContentIterator(mTxtSvcFilter);
1992   *aIterator = static_cast<nsIContentIterator *>(filter);
1993   if (*aIterator) {
1994     NS_IF_ADDREF(*aIterator);
1995     result = filter ? NS_OK : NS_ERROR_FAILURE;
1996   } else {
...
1999   }
...
2002   NS_ENSURE_TRUE(*aIterator, NS_ERROR_NULL_POINTER);

I count 4 null checks of the same value.
(Assignee)

Comment 3

4 years ago
Created attachment 8452488 [details] [diff] [review]
Clean up CreateContentIterator and give nsFilteredContentIterator a private dtor.

try run: https://tbpl.mozilla.org/?tree=Try&rev=a62593216ea0
Attachment #8452488 - Flags: review?(ehsan)

Updated

4 years ago
Attachment #8452488 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/fdbf7d256b43
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.