Closed Bug 12861 Opened 25 years ago Closed 25 years ago

nsStr does not handle memory allocation failures well

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: bruce, Assigned: rickg)

References

Details

(Whiteboard: waiting to hear back from Bruce)

nsStr::Append() calls nsStr::GrowCapacity() which calls nsStr::EnsureCapacity().

In nsStr::EnsureCapacity(), if theAgent->Realloc(aString,aNewLength); fails,
then the AddNullTerminator(aString); will cause a null pointer write.  I had
this happen to me today.
Status: NEW → ASSIGNED
*** Bug 14067 has been marked as a duplicate of this bug. ***
*** Bug 3428 has been marked as a duplicate of this bug. ***
*** Bug 14067 has been marked as a duplicate of this bug. ***
*** Bug 3428 has been marked as a duplicate of this bug. ***
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fixed by improvements to memory management policy in nsString clases.
Whiteboard: waiting to hear back from Bruce
You need to log in before you can comment on or make changes to this bug.