nsReadableUtils ToNew* methods crash on OOM

RESOLVED FIXED

Status

()

--
critical
RESOLVED FIXED
14 years ago
14 years ago

People

(Reporter: ajschult784, Assigned: ajschult784)

Tracking

({crash})

Trunk
x86
Linux
crash
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

14 years ago
The methods in nsReadableUtils that allocate memory (ToNew*) don't check that
the allocation succeeded.  As far as I can tell, they would all crash.  The
Append methods might behave similarly, but the allocation is hidden inside other
methods.

Shouldn't the ToNew* methods just return nsnull?
Summary: nsReadableUitls ToNew* methods crash on OOM → nsReadableUtils ToNew* methods crash on OOM

Comment 1

14 years ago
yeah, sounds fine to me.  patches welcome :)
Severity: normal → critical
Keywords: crash
(Assignee)

Comment 2

14 years ago
Created attachment 175893 [details] [diff] [review]
just return nsnull
Assignee: string → ajschult
Status: NEW → ASSIGNED
Attachment #175893 - Flags: superreview?(darin)
Attachment #175893 - Flags: review?(darin)

Updated

14 years ago
Attachment #175893 - Flags: superreview?(darin)
Attachment #175893 - Flags: superreview+
Attachment #175893 - Flags: review?(darin)
Attachment #175893 - Flags: review+
(Assignee)

Comment 3

14 years ago
fixed
Severity: critical → normal
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Severity: normal → critical
You need to log in before you can comment on or make changes to this bug.