]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/readline/readline52-002
bash: Import upstream fixes
[ipfire-2.x.git] / src / patches / readline / readline52-002
CommitLineData
f19b3cb6
MT
1 READLINE PATCH REPORT
2 =====================
3
4Readline-Release: 5.2
5Patch-ID: readline52-002
6
7Bug-Reported-by: Magnus Svensson <msvensson@mysql.com>
8Bug-Reference-ID: <45BDC44D.80609@mysql.com>
9Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-01/msg00002.html
10
11Bug-Description:
12
13Readline neglects to reallocate the array it uses to keep track of wrapped
14screen lines when increasing its size. This will eventually result in
15segmentation faults when given sufficiently long input.
16
17Patch:
18
19*** ../readline-5.2-patched/display.c Thu Sep 14 14:20:12 2006
20--- display.c Fri Feb 2 20:23:17 2007
21***************
22*** 561,574 ****
23--- 561,586 ----
24 wrap_offset = prompt_invis_chars_first_line = 0;
25 }
26
27+ #if defined (HANDLE_MULTIBYTE)
28 #define CHECK_INV_LBREAKS() \
29 do { \
30 if (newlines >= (inv_lbsize - 2)) \
31 { \
32 inv_lbsize *= 2; \
33 inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
34+ _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
35 } \
36 } while (0)
37+ #else
38+ #define CHECK_INV_LBREAKS() \
39+ do { \
40+ if (newlines >= (inv_lbsize - 2)) \
41+ { \
42+ inv_lbsize *= 2; \
43+ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
44+ } \
45+ } while (0)
46+ #endif /* HANDLE_MULTIBYTE */
47
48 #if defined (HANDLE_MULTIBYTE)
49 #define CHECK_LPOS() \