From 5d95ded15a5c162a1d3c22095b473a0ffd50df29 Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Tue, 3 Dec 2024 10:20:45 +0100 Subject: [PATCH] Make tainted data safe Resolves: RHEL-43596 --- texinfo-7.1-make-tainted-data-safe.patch | 12 ++++++++++++ texinfo.spec | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 texinfo-7.1-make-tainted-data-safe.patch diff --git a/texinfo-7.1-make-tainted-data-safe.patch b/texinfo-7.1-make-tainted-data-safe.patch new file mode 100644 index 0000000..aafae60 --- /dev/null +++ b/texinfo-7.1-make-tainted-data-safe.patch @@ -0,0 +1,12 @@ +diff -up texinfo-7.1/info/makedoc.c.orig texinfo-7.1/info/makedoc.c +--- texinfo-7.1/info/makedoc.c.orig 2023-08-14 20:53:20.000000000 +0200 ++++ texinfo-7.1/info/makedoc.c 2024-10-09 10:13:13.476369921 +0200 +@@ -296,7 +296,7 @@ process_one_file (char *filename, FILE * + char *func, *doc; + char *func_name; + +- for (; offset < (file_size - decl_len); offset++) ++ for (; offset < (file_size - decl_len) && offset < (LONG_MAX - decl_len); offset++) + { + if (buffer[offset] == '\n') + { diff --git a/texinfo.spec b/texinfo.spec index 6999c49..a69d486 100644 --- a/texinfo.spec +++ b/texinfo.spec @@ -3,7 +3,7 @@ Summary: Tools needed to create Texinfo format documentation files Name: texinfo Version: 7.1 -Release: 5%{?dist} +Release: 6%{?dist} License: GPL-3.0-or-later Url: http://www.gnu.org/software/texinfo/ Source0: ftp://ftp.gnu.org/gnu/texinfo/texinfo-%{version}.tar.xz @@ -17,6 +17,8 @@ Patch1: texinfo-6.5-fix-info-dir.patch Patch2: texinfo-6.5-covscan-fixes.patch # Patch3: fixes various issues found by static analysis Patch3: texinfo-7.1-various-sast-fixes.patch +# Patch4: makes tainted data safe +Patch4: texinfo-7.1-make-tainted-data-safe.patch BuildRequires: make BuildRequires: gcc @@ -150,6 +152,10 @@ export ALL_TESTS=yes %{_mandir}/man1/pdftexi2dvi.1* %changelog +* Tue Dec 03 2024 Vitezslav Crhonek - 7.1-6 +- Make tainted data safe + Resolves: RHEL-43596 + * Tue Oct 29 2024 Troy Dawson - 7.1-5 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018