summaryrefslogtreecommitdiff
path: root/cmd-line-utils
diff options
context:
space:
mode:
authormsvensson@pilot.mysql.com <>2007-01-29 12:24:08 +0100
committermsvensson@pilot.mysql.com <>2007-01-29 12:24:08 +0100
commitd42b919a0b14dd2e0a120ca0e1043c9a3c46730e (patch)
tree9594790ad3b0112eed76bc2ab3415a30f5c19523 /cmd-line-utils
parent645de0c5d7525b0481197e4f0a6f67f0f2c2785f (diff)
downloadmariadb-git-d42b919a0b14dd2e0a120ca0e1043c9a3c46730e.tar.gz
Bug#19474 readline bug: mysql: free(): invalid pointer
- Write to uninitialised memory occured since _rl_rapped_lines buffer was not extended in CHECK_INV_LBREAKS macro - Patch submitted to bug-readline@gnu.org
Diffstat (limited to 'cmd-line-utils')
-rw-r--r--cmd-line-utils/readline/display.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c
index 46b57325e33..b8b7ac445e6 100644
--- a/cmd-line-utils/readline/display.c
+++ b/cmd-line-utils/readline/display.c
@@ -524,14 +524,26 @@ rl_redisplay ()
wrap_offset = prompt_invis_chars_first_line = 0;
}
+#if defined (HANDLE_MULTIBYTE)
#define CHECK_INV_LBREAKS() \
do { \
if (newlines >= (inv_lbsize - 2)) \
{ \
inv_lbsize *= 2; \
inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
} \
} while (0)
+#else
+#define CHECK_INV_LBREAKS() \
+ do { \
+ if (newlines >= (inv_lbsize - 2)) \
+ { \
+ inv_lbsize *= 2; \
+ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ } \
+ } while (0)
+#endif
#if defined (HANDLE_MULTIBYTE)
#define CHECK_LPOS() \