From b2fe6678282503374aeea7ab5f468f7a3cc85a2f Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Fri, 11 Jun 2021 17:49:49 -0400 Subject: [PATCH] Fix 54025 (#54070) --- src/coreclr/debug/ee/controller.cpp | 3 ++- src/coreclr/debug/ee/controller.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coreclr/debug/ee/controller.cpp b/src/coreclr/debug/ee/controller.cpp index 7f7fb10..01aedf5 100644 --- a/src/coreclr/debug/ee/controller.cpp +++ b/src/coreclr/debug/ee/controller.cpp @@ -4409,8 +4409,9 @@ DebuggerPatchSkip::DebuggerPatchSkip(Thread *thread, } else { + _ASSERTE(m_instrAttrib.m_cOperandSize <= SharedPatchBypassBuffer::cbBufferBypass); // Copy the data into our buffer. - memcpy(bufferBypass, patch->address + m_instrAttrib.m_cbInstr + dwOldDisp, SharedPatchBypassBuffer::cbBufferBypass); + memcpy(bufferBypass, patch->address + m_instrAttrib.m_cbInstr + dwOldDisp, m_instrAttrib.m_cOperandSize); if (m_instrAttrib.m_fIsWrite) { diff --git a/src/coreclr/debug/ee/controller.h b/src/coreclr/debug/ee/controller.h index 9bcfc86..9fe0a67 100644 --- a/src/coreclr/debug/ee/controller.h +++ b/src/coreclr/debug/ee/controller.h @@ -288,7 +288,7 @@ public: // "PatchBypass" must be the first field of this class for alignment to be correct. BYTE PatchBypass[MAX_INSTRUCTION_LENGTH]; #if defined(TARGET_AMD64) - const static int cbBufferBypass = 0x10; + const static int cbBufferBypass = 0x20; BYTE BypassBuffer[cbBufferBypass]; UINT_PTR RipTargetFixup; -- 2.7.4