From e0db9af2b1636cc6b67ea602003053c4aa995cd7 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 23 Aug 2024 11:34:03 -0700 Subject: [PATCH] Fix range check error re-hashing degenerate files. --- ldid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldid.cpp b/ldid.cpp index b46335b..0769e7e 100644 --- a/ldid.cpp +++ b/ldid.cpp @@ -3630,11 +3630,11 @@ int main(int argc, char *argv[]) { uint8_t *hashes = reinterpret_cast(blob + begin + Swap(directory->hashOffset)); uint32_t pages = Swap(directory->nCodeSlots); - if (pages != 1) + if (pages != 0) { for (size_t i = 0; i != pages - 1; ++i) algorithm(hashes + i * algorithm.size_, top + PageSize_ * i, PageSize_); - if (pages != 0) algorithm(hashes + (pages - 1) * algorithm.size_, top + PageSize_ * (pages - 1), ((data - 1) % PageSize_) + 1); + } } } } -- 2.45.2