From: Jay Freeman (saurik) Date: Sat, 27 Aug 2016 07:50:40 +0000 (-0700) Subject: Add guarantee that allocations shouldn't overflow. X-Git-Tag: v2.1.0~35 X-Git-Url: https://git.saurik.com/ldid.git/commitdiff_plain/4f63b59016d6952f0ddf408a3b1be97f10febc13?ds=inline Add guarantee that allocations shouldn't overflow. --- diff --git a/ldid.cpp b/ldid.cpp index 0c70b40..a4dc725 100644 --- a/ldid.cpp +++ b/ldid.cpp @@ -1171,6 +1171,8 @@ static void Allocate(const void *idata, size_t isize, std::streambuf &output, co size_t saved(save(mach_header, output, allocation.limit_, overlap, top)); if (allocation.alloc_ > saved) pad(output, allocation.alloc_ - saved); + else + _assert(allocation.alloc_ == saved); position += allocation.alloc_; } }