diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2016-08-27 00:50:40 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2016-08-27 00:50:40 -0700 |
commit | 4f63b59016d6952f0ddf408a3b1be97f10febc13 (patch) | |
tree | 2c3bccbbcec8576771ab56236619b58ae0af0980 /ldid.cpp | |
parent | 10ca2b00cab7b80e2275a41fe11205676ee65ead (diff) | |
download | ldid-4f63b59016d6952f0ddf408a3b1be97f10febc13.tar.gz ldid-4f63b59016d6952f0ddf408a3b1be97f10febc13.tar.zst ldid-4f63b59016d6952f0ddf408a3b1be97f10febc13.zip |
Add guarantee that allocations shouldn't overflow.
Diffstat (limited to 'ldid.cpp')
-rw-r--r-- | ldid.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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_; } } |