Last Comment Bug 710992 - Possible bad memset in pixman_image_set_transform()
: Possible bad memset in pixman_image_set_transform()
Status: RESOLVED FIXED
[pvs-studio][good first bug][lang=c++...
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: Thomas Prip Vestergaard [:prip]
:
Mentors:
Depends on:
Blocks: 710966
  Show dependency treegraph
 
Reported: 2011-12-14 23:47 PST by Justin Dolske [:Dolske]
Modified: 2012-01-05 08:14 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Bug 710992 - Fix third argument in memcmp call in pixman-image.c (873 bytes, patch)
2011-12-15 15:46 PST, Thomas Prip Vestergaard [:prip]
roc: review+
Details | Diff | Splinter Review
Bug 710992 - Fix third argument in memcmp call in pixman-image.c (2.11 KB, patch)
2011-12-17 17:48 PST, Thomas Prip Vestergaard [:prip]
no flags Details | Diff | Splinter Review
Bug 710992 - Fix third argument in memcmp call in pixman-image.c (2.00 KB, patch)
2011-12-18 10:54 PST, Thomas Prip Vestergaard [:prip]
roc: review+
Details | Diff | Splinter Review

Description Justin Dolske [:Dolske] 2011-12-14 23:47:54 PST
From http://www.viva64.com/en/a/0078/,
13th section in http://www.viva64.com/external-pictures/txt/mozilla-test.txt

V575 The 'memcmp' function processes '0' elements. Inspect the third argument.
pixman-image.c 520

pixman_bool_t
pixman_image_set_transform (...)
{
  memcmp (common->transform, transform, sizeof (pixman_transform_t) == 0))
}

I think there could be written like this.
memcmp (common->transform, transform, sizeof (pixman_transform_t)) == 0)
Comment 1 Thomas Prip Vestergaard [:prip] 2011-12-15 15:46:56 PST
Created attachment 582133 [details] [diff] [review]
Bug 710992 - Fix third argument in memcmp call in pixman-image.c
Comment 2 Jared Wein [:jaws] (please needinfo? me) 2011-12-15 15:52:57 PST
prip: When you are happy with the state of the patch, please request review from roc by setting the "review?" flag to "roc@ocallahan.org". Thanks for your contribution!
Comment 3 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-12-15 16:35:43 PST
Comment on attachment 582133 [details] [diff] [review]
Bug 710992 - Fix third argument in memcmp call in pixman-image.c

Review of attachment 582133 [details] [diff] [review]:
-----------------------------------------------------------------

This is good. For landing, however, the patch needs to be prepped as a patch in gfx/cairo. See the README there for examples.

Also, this patch really needs to go upstream. Probably should post it to the cairo mailing list.
Comment 4 Thomas Prip Vestergaard [:prip] 2011-12-17 17:48:22 PST
Created attachment 582616 [details] [diff] [review]
Bug 710992 - Fix third argument in memcmp call in pixman-image.c

Prepped as gfx/cairo-patch
Comment 5 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-12-17 23:55:28 PST
Comment on attachment 582616 [details] [diff] [review]
Bug 710992 - Fix third argument in memcmp call in pixman-image.c

+bad-memset.patch: Fix third argument in memcmp call in pixman-image.c

This belongs under "pixman patches"
Comment 6 Thomas Prip Vestergaard [:prip] 2011-12-18 10:54:52 PST
Created attachment 582686 [details] [diff] [review]
Bug 710992 - Fix third argument in memcmp call in pixman-image.c

Sorry - did not know that. Fixed now!
Comment 7 Ed Morley [:emorley] 2011-12-20 07:49:18 PST
In addition to the patch, doesn't the change also need to be made to the actual file?
Comment 8 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-12-20 11:05:56 PST
Comment on attachment 582133 [details] [diff] [review]
Bug 710992 - Fix third argument in memcmp call in pixman-image.c

You're right, Ed. We can just land both of these patches.
Comment 9 :Ms2ger (⌚ UTC+1/+2) 2012-01-02 10:15:46 PST
I'll land it.
Comment 10 :Ms2ger (⌚ UTC+1/+2) 2012-01-03 04:02:11 PST
Thanks for the patch.

https://hg.mozilla.org/mozilla-central/rev/7d23dd6c50eb
Comment 11 Søren Sandmann 2012-01-05 07:44:21 PST
When you discover bugs in pixman, please report them upstream as well. 

Bug reports and patches can be sent to

       pixman@lists.freedesktop.org

or filed here:

       https://bugs.freedesktop.org/enter_bug.cgi?product=pixman

Note You need to log in before you can comment on or make changes to this bug.