Closed Bug 1165729 Opened 7 years ago Closed 7 years ago

Check SetCapacity return value in nsSMILAnimationFunction::GetValues

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: poiru, Assigned: poiru)

References

Details

Attachments

(1 file, 3 obsolete files)

No description provided.
Comment on attachment 8606756 [details] [diff] [review]
Check SetCapacity return value in nsSMILAnimationFunction::GetValues

Looks like |result| (the thing we're calling SetCapacity on) is indeed a typedef for FallibleTArray, ever since bug 937614 landed and changed that typedef.

So yeah, we should be error-checking this SetCapacity call. Thanks for noticing this!

(Out of curiosity, how did you run across this? By auditing calls to SetCapacity & looking if they're on fallible vs. infallible arrays?)
Attachment #8606756 - Flags: review?(dholbert) → review+
(In reply to Daniel Holbert [:dholbert] from comment #2)
> (Out of curiosity, how did you run across this? By auditing calls to
> SetCapacity & looking if they're on fallible vs. infallible arrays?)

For bug 968520, I'm running a Clang AST matcher to automatically find and add `mozilla::fallible` to calls that use the fallible allocator. I noticed this while doing that.

(After bug 968520 lands, the compiler will emit a -Wunused-result warning for code like this!)
Blocks: 968520
https://hg.mozilla.org/mozilla-central/rev/cf12df7923f5
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Attachment #8611384 - Attachment is obsolete: true
Attachment #8611384 - Flags: review?(nfroyd)
(In reply to Pulsebot from comment #11)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/e7061b445ad7

This had the wrong bug number (again...), but I won't bother relanding it since it's a trivial patch. Please ignore and sorry for the bugmail spam.
(In reply to Birunthan Mohanathas [:poiru] from comment #12)
> This had the wrong bug number (again...), but I won't bother relanding it
> since it's a trivial patch. Please ignore and sorry for the bugmail spam.

For future reference, the correct bug is bug 968520.
You need to log in before you can comment on or make changes to this bug.