fix segfault in cpio VFS while reading corrupted RPM (#921414)

This commit is contained in:
Jindrich Novy 2013-03-14 12:00:03 +01:00
parent 8cfd38fd3a
commit 4872acf871
2 changed files with 17 additions and 0 deletions

12
mc-cpiosegfault.patch Normal file
View File

@ -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);

View File

@ -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 <jnovy@redhat.com> 4.8.7-2
- fix segfault in cpio VFS while reading corrupted RPM (#921414)
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.8.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild