Commit 285e7564 authored by Daniel Salzman's avatar Daniel Salzman

mem: fix buffer overflow

parent 4988209b
......@@ -146,7 +146,7 @@ char *strstrip(const char *str)
len -= 1;
}
char *trimmed = malloc(len);
char *trimmed = malloc(len + 1);
if (!trimmed) {
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment