From 5b85dca5722eeead60316cadce8ff3d93dba747d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Aug 2004 01:34:34 +0200 Subject: [PATCH] typo in libedit fixed - possible buffer overflow - bug#4696 --- cmd-line-utils/libedit/history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-line-utils/libedit/history.c b/cmd-line-utils/libedit/history.c index 90d94e7fc18..457c8f4a768 100644 --- a/cmd-line-utils/libedit/history.c +++ b/cmd-line-utils/libedit/history.c @@ -649,7 +649,7 @@ history_save(History *h, const char *fname) retval = HPREV(h, &ev), i++) { len = strlen(ev.str) * 4; if (len >= max_size) { - max_size = (len + 1023) & 1023; + max_size = (len + 1023) & ~1023; ptr = h_realloc(ptr, max_size); } (void) strvis(ptr, ev.str, VIS_WHITE);