Commit 77e0aae7 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

krnl386.exe16: Don't overflow when calculating size.

The application again the bug, passed 1 as the elem parameter which doubled the memory being allocated. When it overflowed (became negative), the value was passed into GlobalAlloc16 which then failed. GlobalAlloc16 takes a DWORD parameter, so the value isn't going to be truncated. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53092 Original patch by github user cracyc for winevdm.
parent c1588b1b
......@@ -945,7 +945,7 @@ static WORD NE_Ne2MemFlags(WORD flags)
*/
DWORD WINAPI MyAlloc16( WORD wFlags, WORD wSize, WORD wElem )
{
WORD size = wSize << wElem;
DWORD size = wSize << wElem;
HANDLE16 hMem = 0;
if (wSize || (wFlags & NE_SEGFLAGS_MOVEABLE))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment