From: Jay Freeman (saurik) Date: Fri, 23 Aug 2024 18:34:03 +0000 (-0700) Subject: Fix range check error re-hashing degenerate files. X-Git-Url: https://git.saurik.com/ldid.git/commitdiff_plain/HEAD?hp=de52e201197211c4a7d15f79068e6f1010e80110 Fix range check error re-hashing degenerate files. --- 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); + } } } }