From ce4791222d62d0ebfe7bde481c6b566805687578 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 9 Nov 2021 05:09:26 -0500 Subject: [PATCH] import bash-4.4.20-2.el8 --- .../bash-5.0-histtimeformat-segfault.patch | 19 +++++++++++++++++++ SPECS/bash.spec | 9 ++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 SOURCES/bash-5.0-histtimeformat-segfault.patch diff --git a/SOURCES/bash-5.0-histtimeformat-segfault.patch b/SOURCES/bash-5.0-histtimeformat-segfault.patch new file mode 100644 index 0000000..0d7efa8 --- /dev/null +++ b/SOURCES/bash-5.0-histtimeformat-segfault.patch @@ -0,0 +1,19 @@ +diff --git a/builtins/history.def b/builtins/history.def +--- a/builtins/history.def ++++ b/builtins/history.def +@@ -256,10 +256,13 @@ histtime (hlist, histtimefmt) + { + static char timestr[128]; + time_t t; ++ struct tm *tm; + + t = history_get_time (hlist); +- if (t) +- strftime (timestr, sizeof (timestr), histtimefmt, localtime (&t)); ++ ++ tm = t ? localtime (&t) : 0; ++ if (t && tm) ++ strftime (timestr, sizeof (timestr), histtimefmt, tm); + else if (hlist->timestamp && hlist->timestamp[0]) + snprintf (timestr, sizeof (timestr), _("%s: invalid timestamp"), + (hlist->timestamp[0] == '#') ? hlist->timestamp + 1: hlist->timestamp); diff --git a/SPECS/bash.spec b/SPECS/bash.spec index 5fe6a89..45bfe14 100644 --- a/SPECS/bash.spec +++ b/SPECS/bash.spec @@ -7,7 +7,7 @@ Version: %{baseversion}%{patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Url: https://www.gnu.org/software/bash Source0: https://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz @@ -112,6 +112,9 @@ Patch136: bash-5.0-cve-2019-18276-2.patch # values Patch137: bash-5.0-bgp-resize.patch +# 1794884 - HISTTIMEFORMAT causes Segmentation fault under certain conditions +Patch138: bash-5.0-histtimeformat-segfault.patch + BuildRequires: texinfo bison BuildRequires: ncurses-devel BuildRequires: autoconf, gettext @@ -335,6 +338,10 @@ end %{_libdir}/pkgconfig/%{name}.pc %changelog +* Mon Jul 26 2021 Siteshwar Vashisht - 4.4.20-2 +- Fix crash if a timestamp in a history file overflowed a time_t + Resolves: #1794884 + * Fri Mar 26 2021 Siteshwar Vashisht - 4.4.20-1 - Fix infinite loop in long running scripts Resolves: #1943495