From 4872acf8714806ba71d4894c5d708ebd218731a9 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Thu, 14 Mar 2013 12:00:03 +0100 Subject: [PATCH] fix segfault in cpio VFS while reading corrupted RPM (#921414) --- mc-cpiosegfault.patch | 12 ++++++++++++ mc.spec | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 mc-cpiosegfault.patch diff --git a/mc-cpiosegfault.patch b/mc-cpiosegfault.patch new file mode 100644 index 0000000..8627031 --- /dev/null +++ b/mc-cpiosegfault.patch @@ -0,0 +1,12 @@ +diff -up mc-4.8.7/src/vfs/cpio/cpio.c.cpiosegfault mc-4.8.7/src/vfs/cpio/cpio.c +--- mc-4.8.7/src/vfs/cpio/cpio.c.cpiosegfault 2012-12-27 09:13:20.000000000 +0100 ++++ mc-4.8.7/src/vfs/cpio/cpio.c 2013-03-14 11:55:50.660147302 +0100 +@@ -795,7 +795,7 @@ cpio_super_same (const vfs_path_element_ + g_free (archive_name); + + /* Has the cached archive been changed on the disk? */ +- if (((cpio_super_data_t *) parc->data)->st.st_mtime < archive_stat->st_mtime) ++ if (parc->data && ((cpio_super_data_t *) parc->data)->st.st_mtime < archive_stat->st_mtime) + { + /* Yes, reload! */ + (*vfs_cpiofs_ops.free) ((vfsid) parc); diff --git a/mc.spec b/mc.spec index 22473c3..ad0ffbb 100644 --- a/mc.spec +++ b/mc.spec @@ -10,6 +10,7 @@ URL: http://www.midnight-commander.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: glib2-devel e2fsprogs-devel slang-devel gpm-devel groff BuildRequires: aspell-devel libssh2-devel >= 1.2.5 +Patch0: mc-cpiosegfault.patch %description Midnight Commander is a visual shell much like a file manager, only @@ -20,6 +21,7 @@ specific files. %prep %setup -q +%patch0 -p1 -b .cpiosegfault %build export CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS -Wno-strict-aliasing" @@ -75,6 +77,9 @@ rm -rf $RPM_BUILD_ROOT %dir %{_libexecdir}/mc/ext.d %changelog +* Thu Mar 14 2013 Jindrich Novy 4.8.7-2 +- fix segfault in cpio VFS while reading corrupted RPM (#921414) + * Thu Feb 14 2013 Fedora Release Engineering - 1:4.8.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild