Re: [PATCH 2/2] gdiplus: Detect integer overflow in GdipCreateBitmapFromScan0.
21 Jul
2008
21 Jul
'08
11:37 a.m.
"Lei Zhang" <thestig(a)google.com> writes:
- datalen = abs(stride * height); + datalen = stride * height; size = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + datalen; + if (datalen <= 0 || size <= 0){ + GdipFree(*bitmap); + *bitmap = NULL; + return InvalidParameter; + }
Testing for overflow is a good idea, but checking for a negative result is not the right way. You can get overflow with a positive result too. -- Alexandre Julliard julliard(a)winehq.org
6356
Age (days ago)
6356
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard