[RTL] Fix overflow case in vDbgPrintExWithPrefixInternal

The string should always be NULL terminated.
This commit is contained in:
Timo Kreuzer 2024-08-21 11:05:09 +03:00
parent f80d978fc0
commit 3cddd76f57

View file

@ -102,10 +102,11 @@ vDbgPrintExWithPrefixInternal(IN PCCH Prefix,
if (Length == MAXULONG)
{
/* Terminate it if we went over-board */
Buffer[sizeof(Buffer) - 1] = '\n';
Buffer[sizeof(Buffer) - 2] = '\n';
Buffer[sizeof(Buffer) - 1] = '\0';
/* Put maximum */
Length = sizeof(Buffer);
Length = sizeof(Buffer) - 1;
}
else
{