From 257abca831aa58e830e52d93aeb8d989cd9cab57 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 19 Aug 2024 02:49:14 -0500 Subject: [PATCH] Revert "warn instead of assert on case where MemPatch application would exceed size of target buffer (which should never happen, if you're applying the patch to the same type it was generated from)" This reverts commit ea02a913b2e15b46ece292f29138cd3ee4cf2eb7. --- src/engine/instrument.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/engine/instrument.cpp b/src/engine/instrument.cpp index 7c3619a3a..924169e16 100644 --- a/src/engine/instrument.cpp +++ b/src/engine/instrument.cpp @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include #include "dataErrors.h" #include "engine.h" #include "instrument.h" @@ -399,11 +400,7 @@ bool MemPatch::calcDiff(const void* pre, const void* post, size_t inputSize) { void MemPatch::applyAndReverse(void* target, size_t targetSize) { if (size==0) return; - if (offset+size>targetSize) { - logW("MemPatch (offset %d, size %d) exceeds target size (%d), can't apply!",offset,size,targetSize); - return; - } - + assert(offset+size<=targetSize); unsigned char* targetBytes=(unsigned char*)target; // swap this->data and its segment on target