From 1e20eed6e8749ed09639ef9d788900edbab0ff83 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Fri, 14 Mar 2025 01:29:22 +0800 Subject: Correct buffer length calculation in dumpSourceBytes (#6593) No functional change as overallocating was ok, but this was wrong Co-authored-by: Yong He --- source/core/slang-hex-dump-util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/core/slang-hex-dump-util.cpp b/source/core/slang-hex-dump-util.cpp index b400fb15b..cf11a9a51 100644 --- a/source/core/slang-hex-dump-util.cpp +++ b/source/core/slang-hex-dump-util.cpp @@ -79,7 +79,7 @@ SlangResult HexDumpUtil::dumpSourceBytes( // each byte is output as "0xAA, " // Ends with '\n" - const size_t lineBytes = count * (4 + 1 + 1) * count + 1; + const size_t lineBytes = count * 6 + 1; char* startDst = writer->beginAppendBuffer(lineBytes); char* dst = startDst; -- cgit v1.2.3