mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
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
This commit is contained in:
parent
645de0c5d7
commit
d42b919a0b
1 changed files with 12 additions and 0 deletions
|
@ -524,6 +524,17 @@ 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)) \
|
||||
|
@ -532,6 +543,7 @@ rl_redisplay ()
|
|||
inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
#define CHECK_LPOS() \
|
||||
|
|
Loading…
Reference in a new issue