Commit fe450cd7 authored by unknown's avatar unknown

libedit safety fix: account for closing \0


cmd-line-utils/libedit/history.c:
  account for closing \0
parent 5803d603
......@@ -647,7 +647,7 @@ history_save(History *h, const char *fname)
for (retval = HLAST(h, &ev);
retval != -1;
retval = HPREV(h, &ev), i++) {
len = strlen(ev.str) * 4;
len = strlen(ev.str) * 4 + 1;
if (len >= max_size) {
max_size = (len + 1023) & ~1023;
ptr = h_realloc(ptr, max_size);
......
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