Fix out-of-bounds write while parsing command-line arguments

This commit is contained in:
2025-12-12 14:44:24 +02:00
parent b5286af526
commit 82bd915274

View File

@@ -16,7 +16,7 @@ const Char* GetCommandLine(int argc, char* argv[])
const Char* cmdLine;
if (length != 0)
{
Char* str = (Char*)malloc(length * sizeof(Char));
Char* str = (Char*)malloc((length + 1) * sizeof(Char));
cmdLine = str;
for (int i = 1; i < argc; i++)
{