Closed
Bug 679618
Opened 13 years ago
Closed 13 years ago
uninitialized memory in gfx/2d/SourceSurfaceCG.cpp
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla9
People
(Reporter: david.volgyes, Assigned: atulagrwl)
References
Details
Attachments
(1 file)
716 bytes,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20100101 Firefox/6.0 Build ID: 20110812233755 Steps to reproduce: cppcheck found this uninitialized memory problem in the code. Actual results: in gfx/2d/SourceSurfaceCG.cpp in InitFromData(...) at line #113: void *data = malloc(aStride * aSize.height); memcpy(aData, data, aStride * aSize.height); Well, the problem is that: if you would like copy from data to aData, then data is uninitialized. (Use calloc, or a memset befopre the copy, etc.) If you would like copy from aData to data, then the order is wrong. Expected results: Fix this uninitialized data problem.
Updated•13 years ago
|
Component: General → Graphics
Product: Firefox → Core
QA Contact: general → thebes
Comment 1•13 years ago
|
||
This is supposed to read memcpy(data, aData, aStride * aSize.height). Is this code actually used? I am amazed this hasn't been noticed before.
Updated•13 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [good first bug] [mentor=jdm]
Assignee | ||
Comment 2•13 years ago
|
||
This is my patch to mozilla. Please let me know if I am missing something.
Attachment #556387 -
Flags: review?
Assignee | ||
Updated•13 years ago
|
Attachment #556387 -
Flags: review? → review?(josh)
Updated•13 years ago
|
Attachment #556387 -
Flags: review?(josh) → review?(jmuizelaar)
Comment 3•13 years ago
|
||
This code is not actually used at this point. As a matter of fact, it isn't even compiled, and it wouldn't compile if you tried to compile it :).
Updated•13 years ago
|
Attachment #556387 -
Flags: review?(jmuizelaar) → review+
Updated•13 years ago
|
Assignee: nobody → atulagrwl
Status: NEW → ASSIGNED
Flags: in-testsuite-
Keywords: checkin-needed
OS: Linux → All
Hardware: x86_64 → All
Comment 5•13 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/5565603c0b7d
Target Milestone: --- → mozilla9
Comment 6•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/5565603c0b7d Thanks Atul :-)
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 7•13 years ago
|
||
Clearing good first bug status to get this off the good first bug buglist!
Whiteboard: [good first bug] [mentor=jdm]
You need to log in
before you can comment on or make changes to this bug.
Description
•