mirror of
https://github.com/nmap/nmap.git
synced 2025-12-24 16:39:03 +00:00
Avoid 1-byte buffer overflow due to not allocating for null terminator
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user