diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-12-20 01:26:22 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-12-20 01:26:22 +0000 |
commit | 0caf9a4c4e4e0c86a3f4d06ba0f49c5c1860b01d (patch) | |
tree | 672067198821d3943bfc73491852b6af9aabef56 /sys-libs/readline/files | |
parent | old (diff) | |
download | gentoo-2-0caf9a4c4e4e0c86a3f4d06ba0f49c5c1860b01d.tar.gz gentoo-2-0caf9a4c4e4e0c86a3f4d06ba0f49c5c1860b01d.tar.bz2 gentoo-2-0caf9a4c4e4e0c86a3f4d06ba0f49c5c1860b01d.zip |
Grab patch from SuSe for segfault #115326 by Seemant Kulleen.
(Portage version: 2.0.53)
Diffstat (limited to 'sys-libs/readline/files')
-rw-r--r-- | sys-libs/readline/files/digest-readline-5.1-r1 | 1 | ||||
-rw-r--r-- | sys-libs/readline/files/readline-5.1-callback-segv.patch | 87 | ||||
-rw-r--r-- | sys-libs/readline/files/readline-5.1-cleanups.patch | 137 |
3 files changed, 225 insertions, 0 deletions
diff --git a/sys-libs/readline/files/digest-readline-5.1-r1 b/sys-libs/readline/files/digest-readline-5.1-r1 new file mode 100644 index 000000000000..69fda4e3389b --- /dev/null +++ b/sys-libs/readline/files/digest-readline-5.1-r1 @@ -0,0 +1 @@ +MD5 7ee5a692db88b30ca48927a13fd60e46 readline-5.1.tar.gz 2030276 diff --git a/sys-libs/readline/files/readline-5.1-callback-segv.patch b/sys-libs/readline/files/readline-5.1-callback-segv.patch new file mode 100644 index 000000000000..94e3bfdccf7a --- /dev/null +++ b/sys-libs/readline/files/readline-5.1-callback-segv.patch @@ -0,0 +1,87 @@ +http://lists.gnu.org/archive/html/bug-bash/2005-12/msg00033.html + +Configuration Information [Automatically generated, do not change]: +Machine: ia64 +OS: linux +Compiler: gcc -I/usr/src/packages/BUILD/bash-3.1 -L/usr/src/packages/BUILD/bash-3.1/../readline-5.1 +Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='ia64' -DCONF_OSTYPE='linux' -DCONF_MACHTYPE='ia64-suse-linux' -DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -pipe -g -fbranch-probabilities +uname output: Linux sykes 2.6.13-15-default #1 SMP Tue Sep 13 14:56:15 UTC 2005 ia64 ia64 ia64 GNU/Linux +Machine Type: ia64-suse-linux + +Bash Version: 3.1 +Patch Level: 0 +Release Status: release + +Description: +When using the readline callback interface (rl_callback_read_char) you'll +get a segfault when using the delete-char function via a multi-character +key. The problem is (1) that rl_delete_char returns non-zero even if +successful and (2) that _rl_dispatch_subseq reports the return value of +any readline function as if it were the result of the keymap dispatch. +The result is that _rl_dispatch_callback doesn't clear the +RL_STATE_MULTIKEY flag, and the next input crashes because _rl_kscxt is +NULL when _rl_dispatch_callback is called the next time. This is only a +problem with the callback interface, because otherwise RL_STATE_MULTIKEY +is never set. + +Repeat-By: +Build gdb with readline 5.1. + +Fix: + lib/readline/readline.c | 2 +- + lib/readline/text.c | 8 +++----- + 2 files changed, 4 insertions(+), 6 deletions(-) + +Index: bash-3.1/lib/readline/text.c +=================================================================== +--- bash-3.1.orig/lib/readline/text.c 2005-12-13 14:07:38.000000000 +0100 ++++ bash-3.1/lib/readline/text.c 2005-12-13 14:09:53.000000000 +0100 +@@ -1071,8 +1071,6 @@ int + rl_delete (count, key) + int count, key; + { +- int r; +- + if (count < 0) + return (_rl_rubout_char (-count, key)); + +@@ -1090,17 +1088,17 @@ rl_delete (count, key) + else + rl_forward_byte (count, key); + +- r = rl_kill_text (orig_point, rl_point); ++ rl_kill_text (orig_point, rl_point); + rl_point = orig_point; +- return r; + } + else + { + int new_point; + + new_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); +- return (rl_delete_text (rl_point, new_point)); ++ rl_delete_text (rl_point, new_point); + } ++ return 0; + } + + /* Delete the character under the cursor, unless the insertion +Index: bash-3.1/lib/readline/readline.c +=================================================================== +--- bash-3.1.orig/lib/readline/readline.c 2005-12-13 14:07:24.000000000 +0100 ++++ bash-3.1/lib/readline/readline.c 2005-12-13 14:38:01.000000000 +0100 +@@ -721,7 +721,7 @@ _rl_dispatch_subseq (key, map, got_subse + + rl_dispatching = 1; + RL_SETSTATE(RL_STATE_DISPATCHING); +- r = (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); ++ (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); + RL_UNSETSTATE(RL_STATE_DISPATCHING); + rl_dispatching = 0; + + + +_______________________________________________ +Bug-bash mailing list +Bug-bash@gnu.org +http://lists.gnu.org/mailman/listinfo/bug-bash diff --git a/sys-libs/readline/files/readline-5.1-cleanups.patch b/sys-libs/readline/files/readline-5.1-cleanups.patch new file mode 100644 index 000000000000..c1f7db670a67 --- /dev/null +++ b/sys-libs/readline/files/readline-5.1-cleanups.patch @@ -0,0 +1,137 @@ +Cleanup misc warnings + +http://lists.gnu.org/archive/html/bug-bash/2005-12/msg00034.html + +--- readline-5.1/bind.c ++++ readline-5.1/bind.c +@@ -1506,8 +1506,6 @@ rl_variable_value (name) + const char *name; + { + register int i; +- int v; +- char *ret; + + /* Check for simple variables first. */ + i = find_boolean_var (name); +@@ -2170,7 +2168,6 @@ _rl_get_string_variable_value (name) + { + static char numbuf[32]; + char *ret; +- int n; + + if (_rl_stricmp (name, "bell-style") == 0) + { +--- readline-5.1/callback.c ++++ readline-5.1/callback.c +@@ -43,6 +43,7 @@ + #include "rldefs.h" + #include "readline.h" + #include "rlprivate.h" ++#include "xmalloc.h" + + /* Private data for callback registration functions. See comments in + rl_callback_read_char for more details. */ +--- readline-5.1/display.c ++++ readline-5.1/display.c +@@ -1164,7 +1166,7 @@ update_line (old, new, current_line, oma + int col_lendiff, col_temp; + #if defined (HANDLE_MULTIBYTE) + mbstate_t ps_new, ps_old; +- int new_offset, old_offset, tmp; ++ int new_offset, old_offset; + #endif + + /* If we're at the right edge of a terminal that supports xn, we're +--- readline-5.1/isearch.c ++++ readline-5.1/isearch.c +@@ -67,10 +67,6 @@ static _rl_search_cxt *_rl_isearch_init + static void _rl_isearch_fini PARAMS((_rl_search_cxt *)); + static int _rl_isearch_cleanup PARAMS((_rl_search_cxt *, int)); + +-/* Last line found by the current incremental search, so we don't `find' +- identical lines many times in a row. */ +-static char *prev_line_found; +- + /* Last search string and its length. */ + static char *last_isearch_string; + static int last_isearch_string_len; +--- readline-5.1/misc.c ++++ readline-5.1/misc.c +@@ -212,6 +212,8 @@ rl_digit_loop () + if (r <= 0 || (RL_ISSTATE (RL_STATE_NUMERICARG) == 0)) + break; + } ++ ++ return 0; + } + + /* Create a default argument. */ +--- readline-5.1/readline.c ++++ readline-5.1/readline.c +@@ -85,7 +85,7 @@ static void bind_arrow_keys_internal PAR + static void bind_arrow_keys PARAMS((void)); + + static void readline_default_bindings PARAMS((void)); +-static void reset_default_bindings PARAMS((void)); ++/* static void reset_default_bindings PARAMS((void)); */ + + static int _rl_subseq_result PARAMS((int, Keymap, int, int)); + static int _rl_subseq_getchar PARAMS((int)); +@@ -1054,6 +1054,7 @@ readline_default_bindings () + + /* Reset the default bindings for the terminal special characters we're + interested in back to rl_insert and read the new ones. */ ++/* Unused function + static void + reset_default_bindings () + { +@@ -1063,6 +1064,7 @@ reset_default_bindings () + rl_tty_set_default_bindings (_rl_keymap); + } + } ++*/ + + /* Bind some common arrow key sequences in MAP. */ + static void +--- readline-5.1/rltty.c ++++ readline-5.1/rltty.c +@@ -933,7 +933,6 @@ rltty_set_default_bindings (kmap) + #if !defined (NO_TTY_DRIVER) + TIOTYPE ttybuff; + int tty; +- static int called = 0; + + tty = fileno (rl_instream); + +--- readline-5.1/search.c ++++ readline-5.1/search.c +@@ -70,7 +70,6 @@ static int rl_history_search_pos; + static char *history_search_string; + static int history_string_size; + +-static UNDO_LIST *noninc_saved_undo_list; + static void make_history_line_current PARAMS((HIST_ENTRY *)); + static int noninc_search_from_pos PARAMS((char *, int, int)); + static int noninc_dosearch PARAMS((char *, int)); +--- readline-5.1/text.c ++++ readline-5.1/text.c +@@ -1239,7 +1239,7 @@ rl_change_case (count, op) + #if defined (HANDLE_MULTIBYTE) + wchar_t wc, nwc; + char mb[MB_LEN_MAX+1]; +- int mblen, p; ++ int mblen; + mbstate_t ps; + #endif + +--- readline-5.1/vi_mode.c ++++ readline-5.1/vi_mode.c +@@ -1111,7 +1111,7 @@ int + rl_vi_rubout (count, key) + int count, key; + { +- int p, opoint; ++ int opoint; + + if (count < 0) + return (rl_vi_delete (-count, key)); |