Skip to content
Snippets Groups Projects
Commit 46de3510 authored by Yorhel's avatar Yorhel
Browse files

Fixed buffer overrun in calc.c

parent 0fe0d11e
Branches
Tags
No related merge requests found
...@@ -343,7 +343,7 @@ void calc_process() { ...@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment