Fix out-of-bounds write while parsing command-line arguments
This commit is contained in:
@@ -16,7 +16,7 @@ const Char* GetCommandLine(int argc, char* argv[])
|
|||||||
const Char* cmdLine;
|
const Char* cmdLine;
|
||||||
if (length != 0)
|
if (length != 0)
|
||||||
{
|
{
|
||||||
Char* str = (Char*)malloc(length * sizeof(Char));
|
Char* str = (Char*)malloc((length + 1) * sizeof(Char));
|
||||||
cmdLine = str;
|
cmdLine = str;
|
||||||
for (int i = 1; i < argc; i++)
|
for (int i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user