summaryrefslogtreecommitdiff
path: root/cmd-line-utils
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-08-21 23:53:42 +0200
committerunknown <serg@serg.mylan>2004-08-21 23:53:42 +0200
commit3c0f5cef01a812e5baca13167ecd58d0f0840b8e (patch)
tree5668aa80ad86de8096b9d422a0fa1b227e26276f /cmd-line-utils
parent7bfc5802111d6dde21ef61086b4d7cc5bdc2e722 (diff)
downloadmariadb-git-3c0f5cef01a812e5baca13167ecd58d0f0840b8e.tar.gz
libedit safety fix: account for closing \0
cmd-line-utils/libedit/history.c: account for closing \0
Diffstat (limited to 'cmd-line-utils')
-rw-r--r--cmd-line-utils/libedit/history.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd-line-utils/libedit/history.c b/cmd-line-utils/libedit/history.c
index 457c8f4a768..bae50787b94 100644
--- a/cmd-line-utils/libedit/history.c
+++ b/cmd-line-utils/libedit/history.c
@@ -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);