diff --git a/backport-Avoid-reading-from-invalid-memory.patch b/backport-Avoid-reading-from-invalid-memory.patch new file mode 100644 index 0000000..6f4eeaa --- /dev/null +++ b/backport-Avoid-reading-from-invalid-memory.patch @@ -0,0 +1,32 @@ +From 61f2d86d93e46309f5721b3700e1b189350282dd Mon Sep 17 00:00:00 2001 +From: "G. Branden Robinson" +Date: Fri, 3 Feb 2023 05:11:46 -0600 +Subject: [tbl]: Fix Savannah #63751. + +* src/preproc/tbl/main.cpp (main): Avoid reading from invalid memory + upon failure to open an input file. + +Fixes . +--- + src/preproc/tbl/main.cpp | 4 +++- + 1 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp +index 467c19f..a3308ba 100644 +--- a/src/preproc/tbl/main.cpp ++++ b/src/preproc/tbl/main.cpp +@@ -1658,8 +1658,10 @@ int main(int argc, char **argv) + else { + errno = 0; + FILE *fp = fopen(argv[i], "r"); +- if (fp == 0) ++ if (fp == 0) { ++ current_filename = 0 /* nullptr */; + fatal("can't open '%1': %2", argv[i], strerror(errno)); ++ } + else { + current_lineno = 1; + string fn(argv[i]); +-- +cgit v1.1 + diff --git a/groff.spec b/groff.spec index 19049d7..c981c5a 100644 --- a/groff.spec +++ b/groff.spec @@ -2,12 +2,13 @@ %{!?with_x:%global with_x 1} Name: groff Version: 1.22.4 -Release: 11 +Release: 12 Summary: A typesetting system License: GPLv3+ and GFDL and BSD and MIT URL: http://www.gnu.org/software/groff/ Source: http://ftp.gnu.org/gnu/groff/groff-%{version}.tar.gz Patch3000: groff-1.22.4-sw.patch +Patch6000: backport-Avoid-reading-from-invalid-memory.patch BuildRequires: gcc, gcc-c++ texinfo BuildRequires: git, netpbm-progs, perl-generators, psutils, ghostscript @@ -323,6 +324,9 @@ make check %{_infodir}/groff.info* %changelog +* Mon Apr 08 2024 shixuantong - 1.22.4-12 +- Avoid reading from invalid memory upon failure to open an input file + * Tue Apr 11 2023 yangchenguang - 1.22.4-11 - fix groff build failed