[PATCH 1/2] user32: Remove redundant sizeof check.

Ken Thomases ken at codeweavers.com
Wed Oct 24 04:04:06 CDT 2012


On Oct 24, 2012, at 3:24 AM, Michael Stefaniuc wrote:

> @@ -1330,9 +1330,6 @@ static HICON CURSORICON_LoadFromFile( LPCWSTR filename,
>     }
> 
>     dir = (const CURSORICONFILEDIR*) bits;
> -    if ( filesize < sizeof(*dir) )
> -        goto end;
> -
>     if ( filesize < (sizeof(*dir) + sizeof(dir->idEntries[0])*(dir->idCount-1)) )
>         goto end;
> 

That doesn't seem redundant to me.  It's not safe to access dir->idCount if the file isn't known to be big enough.

Regards,
Ken




More information about the wine-devel mailing list