Fix buffer overflow in assert (#35902)
authorCarol Eidt <carol.eidt@microsoft.com>
Thu, 7 May 2020 15:12:26 +0000 (08:12 -0700)
committerGitHub <noreply@github.com>
Thu, 7 May 2020 15:12:26 +0000 (08:12 -0700)
src/coreclr/src/jit/importer.cpp

index 41c5e25..aae168c 100644 (file)
@@ -17494,7 +17494,7 @@ void Compiler::impImportBlockPending(BasicBlock* block)
 #ifdef DEBUG
             char buffer[400];
             sprintf_s(buffer, sizeof(buffer),
-                      "Block at offset %4.4x to %4.4x in %s entered with different stack depths.\n"
+                      "Block at offset %4.4x to %4.4x in %0.200s entered with different stack depths.\n"
                       "Previous depth was %d, current depth is %d",
                       block->bbCodeOffs, block->bbCodeOffsEnd, info.compFullName, block->bbStkDepth,
                       verCurrentState.esStackDepth);