The default bug view has changed. See this FAQ.

Ineffective allocation check in NS_NewSVGCairoPathBuilder (nsSVGCairoPathBuilder.cpp)

RESOLVED FIXED

Status

()

Core
SVG
--
minor
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Kenneth Herron, Assigned: rflint)

Tracking

({coverity, fixed1.8.0.7, fixed1.8.1})

1.8 Branch
coverity, fixed1.8.0.7, fixed1.8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
This was found through a coverity scan of the mozilla source. |NS_NewSVGCairoPathBuilder| in nsSVGCairoPathBuilder.cpp contains the following code:

 86 nsresult
 87 NS_NewSVGCairoPathBuilder(nsISVGRendererPathBuilder **result,
 88                           cairo_t *ctx)
 89 {
 90   *result = new nsSVGCairoPathBuilder(ctx);
 91   if (!result)
 92     return NS_ERROR_OUT_OF_MEMORY;
 93 
 94   NS_ADDREF(*result);

Shirley line 91 should be testing |*result|, not |result|.
(Reporter)

Updated

11 years ago
Whiteboard: [good first bug]
Keywords: coverity
Created attachment 219219 [details] [diff] [review]
Fix null check on *result
Assignee: general → rflint
Status: NEW → ASSIGNED
Attachment #219219 - Flags: superreview?(tor)
Attachment #219219 - Flags: review?(pavlov)
Comment on attachment 219219 [details] [diff] [review]
Fix null check on *result

r=jwatt
Attachment #219219 - Flags: review?(pavlov) → review+

Comment 3

11 years ago
Comment on attachment 219219 [details] [diff] [review]
Fix null check on *result

File no longer exists on trunk, but could be taken for the 1.8.* branches.
Attachment #219219 - Flags: superreview?(tor) → superreview+
Attachment #219219 - Flags: approval1.8.1?
Attachment #219219 - Flags: approval1.8.0.6?

Comment 4

11 years ago
Comment on attachment 219219 [details] [diff] [review]
Fix null check on *result

a=darin on behalf of drivers
Attachment #219219 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [good first bug] → [checkin needed]
Version: Trunk → 1.8 Branch
mozilla/layout/svg/renderer/src/cairo/Attic/nsSVGCairoPathBuilder.cpp 1.6.6.1
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Comment on attachment 219219 [details] [diff] [review]
Fix null check on *result

approved for 1.8.0 branch, a=dveditz for drivers
Attachment #219219 - Flags: approval1.8.0.7? → approval1.8.0.7+
Whiteboard: [checkin needed (1.8.0 branch)]
Fix checked into 1.8.0 branch
Keywords: fixed1.8.0.7
Whiteboard: [checkin needed (1.8.0 branch)]
You need to log in before you can comment on or make changes to this bug.