Skip to content

Commit 054e65c

Browse files
authored
Merge pull request #34 from tonghuaroot/fix/uefi-deps-expr-oob-26.01
UefiHandler: fix off-by-one OOB read in ParseDepedencyExpression (backport 7-Zip 26.01)
2 parents fdb9648 + a558758 commit 054e65c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

CPP/7zip/Archive/UefiHandler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ static bool ParseDepedencyExpression(const Byte *p, UInt32 size, AString &res)
396396
res.Empty();
397397
for (UInt32 i = 0; i < size;)
398398
{
399-
unsigned command = p[i++];
400-
if (command > Z7_ARRAY_SIZE(kExpressionCommands))
399+
const unsigned command = p[i++];
400+
if (command >= Z7_ARRAY_SIZE(kExpressionCommands))
401401
return false;
402402
res += kExpressionCommands[command];
403403
if (command < 3)

0 commit comments

Comments
 (0)