mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-16 02:03:00 -07: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…
Add table
Add a link
Reference in a new issue