diff --git a/diffutils-3.11-allocation-typo-leading-to-crashes.patch b/diffutils-3.11-allocation-typo-leading-to-crashes.patch new file mode 100644 index 0000000..31796ca --- /dev/null +++ b/diffutils-3.11-allocation-typo-leading-to-crashes.patch @@ -0,0 +1,26 @@ +diff --git a/NEWS b/NEWS +index 73d98d6..bfc4035 100644 +--- a/NEWS ++++ b/NEWS +@@ -8,6 +8,9 @@ GNU diffutils NEWS -*- outline -*- + file to a nonempty regular file. + [bug#76452 introduced in 3.11] + ++ diff -y no longer crashes when given nontrivial differences. ++ [bug#76613 introduced in 3.11] ++ + + * Noteworthy changes in release 3.11 (2025-02-02) [stable] + +diff --git a/src/io.c b/src/io.c +index a62c529..eba4aba 100644 +--- a/src/io.c ++++ b/src/io.c +@@ -1012,7 +1012,7 @@ find_and_hash_each_line (struct file_data *current) + linbuf += linbuf_base; + linbuf = xpalloc (linbuf, &n, 1, -1, sizeof *linbuf); + linbuf -= linbuf_base; +- alloc_lines = n - linbuf_base; ++ alloc_lines = linbuf_base + n; + } + linbuf[line] = p; diff --git a/diffutils.spec b/diffutils.spec index 53fd5b4..82ee291 100644 --- a/diffutils.spec +++ b/diffutils.spec @@ -1,9 +1,11 @@ Summary: GNU collection of diff utilities Name: diffutils Version: 3.11 -Release: 1%{?dist} +Release: 2%{?dist} URL: https://www.gnu.org/software/diffutils/diffutils.html Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz +# upstream fixes +Patch10: diffutils-3.11-allocation-typo-leading-to-crashes.patch License: GPL-3.0-or-later Provides: bundled(gnulib) BuildRequires: gcc @@ -53,6 +55,9 @@ make check %{_infodir}/diffutils.info* %changelog +* Thu Mar 27 2025 Than Ngo - 3.11-2 +- Backported upstream patch, Fixed allocation typo leading to crash + * Thu Mar 27 2025 Than Ngo - 3.11-1 - Fixed rhbz#2343469, Update to 3.11