getFileType error on non-MZ
Status: Alpha
Brought to you by:
rheiny
in the openPeFile call,
in the getFileType call
you check the return from mzHeader.read() blah for NO_ERROR, however
in mzHeader::read so long as the file is big enough to hold the buffer, it will return NO_ERROR (even for NON-MZ files).
This is a serious error and can be fixed by the following .
Replace:
return NO_ERROR;
with:
if (vBuffer[0] == 'M' && vBuffer[1] == 'Z')
return NO_ERROR;
else
return ERROR_INVALID_FILE;