Commit 8ab1fc5f authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

user32: Use FIELD_OFFSET to calculate the size of a struct with variable length array.

parent 7d4605db
......@@ -1330,7 +1330,7 @@ static HICON CURSORICON_LoadFromFile( LPCWSTR filename,
}
dir = (const CURSORICONFILEDIR*) bits;
if ( filesize < (sizeof(*dir) + sizeof(dir->idEntries[0])*(dir->idCount-1)) )
if ( filesize < FIELD_OFFSET( CURSORICONFILEDIR, idEntries[dir->idCount] ))
goto end;
if ( fCursor )
......
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