mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 07:58:22 +08:00
parent
516949a6e6
commit
bf3adbe4c6
@ -1467,6 +1467,11 @@ USTATUS FfsParser::parseVolumeBody(const UModelIndex & index)
|
||||
while (fileOffset < volumeBodySize) {
|
||||
UINT32 fileSize = getFileSize(volumeBody, fileOffset, ffsVersion);
|
||||
|
||||
if (fileSize == 0) {
|
||||
msg(usprintf("%s: file header parsing failed with invalid size", __FUNCTION__), index);
|
||||
return U_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// Check that we are at the empty space
|
||||
UByteArray header = volumeBody.mid(fileOffset, (int)std::min(sizeof(EFI_FFS_FILE_HEADER), (size_t)volumeBodySize - fileOffset));
|
||||
if (header.count(emptyByte) == header.size()) { //Empty space
|
||||
|
Loading…
Reference in New Issue
Block a user