user32: Use FIELD_OFFSET to calculate the size of a struct with variable length array.
This commit is contained in:
parent
7d4605db41
commit
8ab1fc5ff7
dlls/user32
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue