Module: wine Branch: master Commit: 8ab1fc5ff795a0f0a71e7779ca8f563c62198d5d URL: http://source.winehq.org/git/wine.git/?a=commit;h=8ab1fc5ff795a0f0a71e7779ca...
Author: Michael Stefaniuc mstefani@redhat.de Date: Wed Oct 24 10:26:02 2012 +0200
user32: Use FIELD_OFFSET to calculate the size of a struct with variable length array.
---
dlls/user32/cursoricon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 62afa3d..8f6f9ce 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -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 )