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

This commit is contained in:
Michael Stefaniuc 2012-10-24 10:26:02 +02:00 committed by Alexandre Julliard
parent 7d4605db41
commit 8ab1fc5ff7
1 changed files with 1 additions and 1 deletions

View File

@ -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 )