If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

nsObserverList::GetObserverList should return OOM on failure

RESOLVED FIXED

Status

()

Core
XPCOM
RESOLVED FIXED
14 years ago
13 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

14 years ago
consider this call chain:
nsObserverService::NotifyObservers
nsObserverService::EnumerateObservers
nsObserverService::GetObserverList
nsObserverList::GetObserverList

139     ObserverListEnumerator * enumerator= new
ObserverListEnumerator(mObserverList);
140     NS_IF_ADDREF(enumerator);
141     *anEnumerator = enumerator;
142     return NS_OK;

let new fail.
anEnumerator = 0
return NS_OK

this bubbles to 
199     rv = EnumerateObservers( aTopic, getter_AddRefs(observers) );
200     if ( NS_FAILED( rv ) )
false, so skip return
201         return rv;

203     while( NS_SUCCEEDED(observers->HasMoreElements(&loop)) && loop) 
null, so crash.
(Assignee)

Comment 1

14 years ago
Created attachment 144945 [details] [diff] [review]
return failure
(Assignee)

Updated

14 years ago
Attachment #144945 - Flags: review?(dougt)

Updated

13 years ago
Attachment #144945 - Flags: review?(dougt) → review+
(Assignee)

Comment 2

13 years ago
mozilla/xpcom/ds/nsObserverList.cpp 	3.31
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.