In NtGdiGetDIBitsInternal limit the size of what is being copied back to to usermode to the cjMaxInfo parameter. Fixes crash of Firefox when downloading files.
CORE-8895 #resolve

svn path=/trunk/; revision=66273
This commit is contained in:
Timo Kreuzer 2015-02-15 00:05:50 +00:00
parent 5b0af50bdc
commit e07232f673

View file

@ -674,7 +674,7 @@ GreGetDIBitsInternal(
RGBQUAD* rgbQuads;
VOID* colorPtr;
DPRINT("Entered NtGdiGetDIBitsInternal()\n");
DPRINT("Entered GreGetDIBitsInternal()\n");
if ((Usage && Usage != DIB_PAL_COLORS) || !Info || !hBitmap)
return 0;
@ -1090,7 +1090,7 @@ NtGdiGetDIBitsInternal(
_SEH2_TRY
{
/* Copy the data back */
cjMaxInfo = DIB_BitmapInfoSize(pbmi, (WORD)iUsage);
cjMaxInfo = min(cjMaxInfo, DIB_BitmapInfoSize(pbmi, (WORD)iUsage));
ProbeForWrite(pbmiUser, cjMaxInfo, 1);
RtlCopyMemory(pbmiUser, pbmi, cjMaxInfo);
}