mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-15 15:44:54 -04:00
parent
516949a6e6
commit
bf3adbe4c6
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue