Closed
Bug 324981
Opened 20 years ago
Closed 20 years ago
nsTArray crash in RemoveElement
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: brettw, Assigned: darin.moz)
Details
(Keywords: fixed1.8.1)
Attachments
(1 file)
2.08 KB,
patch
|
benjamin
:
review+
benjamin
:
approval1.8.1+
|
Details | Diff | Splinter Review |
RemoveElement will crash when the element is not found. It compares the result of IndexOf with >= 0, but the type is UInt, so it will always be true. You want to compare it to NoIndex to test for failure.
Testcase:
nsTArray<int> foo;
foo.RemoveElement(5);
I'd fix this myself but I'm unsure what branches this would need to be checked into, etc.
Assignee | ||
Comment 1•20 years ago
|
||
No worries. I've got it.
Severity: normal → critical
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.9alpha
Assignee | ||
Comment 2•20 years ago
|
||
Attachment #209921 -
Flags: review?(benjamin)
Updated•20 years ago
|
Attachment #209921 -
Flags: review?(benjamin)
Attachment #209921 -
Flags: review+
Attachment #209921 -
Flags: approval1.8.1+
Assignee | ||
Comment 3•20 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•