Closed Bug 334718 Opened 18 years ago Closed 18 years ago

Ineffective allocation check in NS_NewSVGCairoPathBuilder (nsSVGCairoPathBuilder.cpp)

Categories

(Core :: SVG, defect)

1.8 Branch
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: kherron+mozilla, Assigned: rflint)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity, fixed1.8.0.7, fixed1.8.1)

Attachments

(1 file)

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|.
Whiteboard: [good first bug]
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 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 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
Closed: 18 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.

Attachment

General

Created:
Updated:
Size: