summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-11-10 01:01:14 -0500
committerMike Frysinger <vapier@gentoo.org>2016-11-10 01:01:14 -0500
commit4b0bd0d1d7636f79c4c1a65ab280c7f9009ff26e (patch)
treecd587b6ab0f66e0f329303eb0142dc15b58f6fd6 /sys-libs
parentsys-apps/pciutils: update lib deps (diff)
downloadgentoo-4b0bd0d1d7636f79c4c1a65ab280c7f9009ff26e.tar.gz
gentoo-4b0bd0d1d7636f79c4c1a65ab280c7f9009ff26e.tar.bz2
gentoo-4b0bd0d1d7636f79c4c1a65ab280c7f9009ff26e.zip
sys-libs/readline: add upstream patch for excessive history memory allocs #597006
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/readline/files/readline-7.0-history-alloclist.patch29
-rw-r--r--sys-libs/readline/readline-7.0-r1.ebuild (renamed from sys-libs/readline/readline-7.0.ebuild)1
2 files changed, 30 insertions, 0 deletions
diff --git a/sys-libs/readline/files/readline-7.0-history-alloclist.patch b/sys-libs/readline/files/readline-7.0-history-alloclist.patch
new file mode 100644
index 000000000000..73faa60fcd2d
--- /dev/null
+++ b/sys-libs/readline/files/readline-7.0-history-alloclist.patch
@@ -0,0 +1,29 @@
+https://bugs.gentoo.org/597006
+https://lists.gnu.org/archive/html/bug-bash/2016-10/msg00010.html
+
+*** ../bash-4.4/lib/readline/history.c 2015-12-28 13:50:31.000000000 -0500
+--- lib/readline/history.c 2016-09-30 14:28:40.000000000 -0400
+***************
+*** 58,61 ****
+--- 58,63 ----
+ #define DEFAULT_HISTORY_INITIAL_SIZE 502
+
++ #define MAX_HISTORY_INITIAL_SIZE 8192
++
+ /* The number of slots to increase the_history by. */
+ #define DEFAULT_HISTORY_GROW_SIZE 50
+***************
+*** 308,312 ****
+ {
+ if (history_stifled && history_max_entries > 0)
+! history_size = history_max_entries + 2;
+ else
+ history_size = DEFAULT_HISTORY_INITIAL_SIZE;
+--- 310,316 ----
+ {
+ if (history_stifled && history_max_entries > 0)
+! history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
+! ? MAX_HISTORY_INITIAL_SIZE
+! : history_max_entries + 2;
+ else
+ history_size = DEFAULT_HISTORY_INITIAL_SIZE;
diff --git a/sys-libs/readline/readline-7.0.ebuild b/sys-libs/readline/readline-7.0-r1.ebuild
index 56fddcb95938..aecaa1cb43e4 100644
--- a/sys-libs/readline/readline-7.0.ebuild
+++ b/sys-libs/readline/readline-7.0-r1.ebuild
@@ -54,6 +54,7 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-5.0-no_rpath.patch
epatch "${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch #385091
epatch "${FILESDIR}"/${PN}-7.0-headers.patch
+ epatch "${FILESDIR}"/${PN}-7.0-history-alloclist.patch #597006
# Force ncurses linking. #71420
# Use pkg-config to get the right values. #457558