mirror of
https://github.com/MariaDB/server.git
synced 2026-04-27 10:45:30 +02:00
libedit safety fix: account for closing \0
cmd-line-utils/libedit/history.c: account for closing \0
This commit is contained in:
parent
5803d60379
commit
fe450cd719
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue