summaryrefslogtreecommitdiff
path: root/cmd-line-utils
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.mysql.com>2007-01-29 12:24:08 +0100
committerunknown <msvensson@pilot.mysql.com>2007-01-29 12:24:08 +0100
commit9a0b8eb1eae6f590c4ffc5d372a6f105a26c1bfa (patch)
tree9594790ad3b0112eed76bc2ab3415a30f5c19523 /cmd-line-utils
parent7d4477f866d26b8bd8e941e6484d843cc30c83c8 (diff)
downloadmariadb-git-9a0b8eb1eae6f590c4ffc5d372a6f105a26c1bfa.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 cmd-line-utils/readline/display.c: Extend _rl_wrapped_lines everytime inv_lbsize is increased
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() \