Fix 54025 (#54070)
authorSteve MacLean <Steve.MacLean@microsoft.com>
Fri, 11 Jun 2021 21:49:49 +0000 (17:49 -0400)
committerGitHub <noreply@github.com>
Fri, 11 Jun 2021 21:49:49 +0000 (17:49 -0400)
src/coreclr/debug/ee/controller.cpp
src/coreclr/debug/ee/controller.h

index 7f7fb10..01aedf5 100644 (file)
@@ -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)
             {
index 9bcfc86..9fe0a67 100644 (file)
@@ -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;