Off-by-one bug

This commit is contained in:
Andrei Pangin
2022-01-05 03:55:23 +03:00
parent a57bbf3587
commit 605550cf96

View File

@@ -110,7 +110,7 @@ Error Arguments::parse(const char* args) {
size_t len = strlen(args);
free(_buf);
_buf = (char*)malloc(len + EXTRA_BUF_SIZE);
_buf = (char*)malloc(len + EXTRA_BUF_SIZE + 1);
if (_buf == NULL) {
return Error("Not enough memory to parse arguments");
}