mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Avoid 1-byte buffer overflow due to not allocating for null terminator
This commit is contained in:
parent
367dc67f5a
commit
dbbc420d99
1 changed files with 1 additions and 1 deletions
|
|
@ -347,7 +347,7 @@ char **cmdline_split(const char *cmdexec)
|
|||
|
||||
/* The line is not empty so we've got something to deal with */
|
||||
cmd_args = (char **) safe_malloc(sizeof(char *) * (max_tokens + 1));
|
||||
cur_arg = (char *) Calloc(sizeof(char), strlen(cmdexec));
|
||||
cur_arg = (char *) Calloc(sizeof(char), strlen(cmdexec) + 1);
|
||||
|
||||
/* Get and copy the tokens */
|
||||
ptr = cmdexec;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue