mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
libedit safety fix: account for closing \0
cmd-line-utils/libedit/history.c: account for closing \0
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user