mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-14 03:03:14 +08:00
fixed cmd malloc strlen()+1 bug
This commit is contained in:
parent
04202e7aa7
commit
8ca5586d49
1 changed files with 1 additions and 1 deletions
|
@ -91,7 +91,7 @@ static void *main_loop(void *targ)
|
|||
nl = strrchr(script_cmd_buf, '\n');
|
||||
if (nl) *nl = '\0';
|
||||
|
||||
if ((cmd = (char*) malloc(strlen(script_cmd_buf))) != NULL)
|
||||
if ((cmd = (char*) malloc(strlen(script_cmd_buf) + 1)) != NULL)
|
||||
{
|
||||
memset(cmd, 0, strlen(script_cmd_buf));
|
||||
strcpy(cmd, script_cmd_buf);
|
||||
|
|
Loading…
Reference in a new issue