diff --git a/patch-args-segfault.patch b/patch-args-segfault.patch new file mode 100644 index 0000000..b2e3404 --- /dev/null +++ b/patch-args-segfault.patch @@ -0,0 +1,20 @@ +diff -up patch-2.7.1/src/patch.c.args-segfault patch-2.7.1/src/patch.c +--- patch-2.7.1/src/patch.c.args-segfault 2013-06-12 16:48:50.617108731 +0100 ++++ patch-2.7.1/src/patch.c 2013-06-12 16:49:06.790181916 +0100 +@@ -150,6 +150,8 @@ main (int argc, char **argv) + else if ((version_control = getenv ("VERSION_CONTROL"))) + version_control_context = "$VERSION_CONTROL"; + ++ init_files_to_output (); ++ + /* parse switches */ + Argc = argc; + Argv = argv; +@@ -164,7 +166,6 @@ main (int argc, char **argv) + + init_backup_hash_table (); + init_files_to_delete (); +- init_files_to_output (); + + init_output (&outstate); + if (outfile) diff --git a/patch.spec b/patch.spec index 698e982..61996f0 100644 --- a/patch.spec +++ b/patch.spec @@ -1,13 +1,14 @@ Summary: Utility for modifying/upgrading files Name: patch Version: 2.7.1 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ URL: http://www.gnu.org/software/patch/patch.html Group: Development/Tools Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.xz Patch1: patch-remove-empty-dir.patch Patch2: patch-args.patch +Patch3: patch-args-segfault.patch Patch100: patch-selinux.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -34,6 +35,9 @@ applications. # Don't document unsupported -m option; document -x option (bug #948972). %patch2 -p1 -b .args +# Don't segfault when given bad arguments (bug #972330). +%patch3 -p1 -b .args-segfault + # SELinux support. %patch100 -p1 -b .selinux @@ -62,6 +66,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/*/* %changelog +* Wed Jun 12 2013 Tim Waugh 2.7.1-6 +- Don't segfault when given bad arguments (bug #972330). + * Thu Apr 11 2013 Tim Waugh 2.7.1-5 - Don't document unsupported -m option; document -x option (bug #948972).