mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-14 09:48:40 -09:00
Fixed buffer overrun in calc.c
This commit is contained in:
parent
0fe0d11e3b
commit
46de3510cd
1 changed files with 1 additions and 1 deletions
|
|
@ -343,7 +343,7 @@ void calc_process() {
|
||||||
t->name = malloc(strlen(orig->name)+1);
|
t->name = malloc(strlen(orig->name)+1);
|
||||||
strcpy(t->name, orig->name);
|
strcpy(t->name, orig->name);
|
||||||
} else {
|
} else {
|
||||||
t->name = malloc(strlen(path)+strlen(name)+1);
|
t->name = malloc(strlen(path)+strlen(name)+2);
|
||||||
t->name[0] = 0;
|
t->name[0] = 0;
|
||||||
if(strcmp(path, "/"))
|
if(strcmp(path, "/"))
|
||||||
strcpy(t->name, path);
|
strcpy(t->name, path);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue