mirror of
https://github.com/dvorka/hstr.git
synced 2024-12-26 17:33:50 +08:00
Missing null termination fix in the shell detection #463 from ihsinme/patch-1
This commit is contained in:
commit
f945c7f209
1 changed files with 1 additions and 1 deletions
|
@ -217,7 +217,7 @@ char *get_shell_name_by_ppid(const int pid)
|
|||
shell=strrchr(shell,'/');
|
||||
if(shell != NULL) {
|
||||
shell++;
|
||||
unsigned len=strlen(shell)*sizeof(char);
|
||||
unsigned len=(strlen(shell)+1)*sizeof(char);
|
||||
name = realloc(name, len);
|
||||
strncpy(name, shell, len);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue