rpms/mc/devel mc-vfsfail.patch,NONE,1.1 mc.spec,1.150,1.151

Jindrich Novy jnovy at fedoraproject.org
Mon Oct 12 12:50:24 UTC 2009


Author: jnovy

Update of /cvs/pkgs/rpms/mc/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10446

Modified Files:
	mc.spec 
Added Files:
	mc-vfsfail.patch 
Log Message:
* Mon Oct 12 2009 Jindrich Novy <jnovy at redhat.com> 4.7.0-0.6.pre3
- fix segfault while browsing various archives via VFS (#528268)


mc-vfsfail.patch:
 vfs.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

--- NEW FILE mc-vfsfail.patch ---
diff -up mc-4.7.0/vfs/vfs.c.jn mc-4.7.0/vfs/vfs.c
--- mc-4.7.0/vfs/vfs.c.jn	2009-10-12 13:57:18.000000000 +0200
+++ mc-4.7.0/vfs/vfs.c	2009-10-12 14:34:04.000000000 +0200
@@ -675,6 +675,9 @@ int
 mc_ctl (int handle, int ctlop, void *arg)
 {
     struct vfs_class *vfs = vfs_op (handle);
+    
+    if (vfs == NULL)
+        return 0;
 
     return vfs->ctl ? (*vfs->ctl)(vfs_info (handle), ctlop, arg) : 0;
 }
@@ -708,6 +711,10 @@ mc_close (int handle)
 	return -1;
     
     vfs = vfs_op (handle);
+    
+    if (vfs == NULL)
+    	return -1;
+    
     if (handle < 3)
 	return close (handle);
 
@@ -798,6 +805,8 @@ mc_readdir (DIR *dirp)
     }
     handle = *(int *) dirp;
     vfs = vfs_op (handle);
+    if (vfs == NULL)
+    	return NULL;
     dirinfo = vfs_info (handle);
     if (vfs->readdir) {
         entry = (*vfs->readdir) (dirinfo->info);
@@ -820,6 +829,9 @@ mc_closedir (DIR *dirp)
     int result;
     struct vfs_dirinfo *dirinfo;
 
+    if (vfs == NULL)
+    	return -1;
+
     dirinfo = vfs_info (handle);
     if (dirinfo->converter != str_cnv_from_term) str_close_conv (dirinfo->converter);
 
@@ -874,6 +886,8 @@ int mc_fstat (int handle, struct stat *b
     if (handle == -1)
 	return -1;
     vfs = vfs_op (handle);
+    if (vfs == NULL)
+    	return -1;
     result = vfs->fstat ? (*vfs->fstat) (vfs_info (handle), buf) : -1;
     if (result == -1)
 	errno = vfs->name ? ferrno (vfs) : E_NOTSUPP;
@@ -967,6 +981,8 @@ off_t mc_lseek (int fd, off_t offset, in
 	return -1;
 
     vfs = vfs_op (fd);
+    if (vfs == NULL)
+    	return -1;
     result = vfs->lseek ? (*vfs->lseek)(vfs_info (fd), offset, whence) : -1;
     if (result == -1)
         errno = vfs->lseek ? ferrno (vfs) : E_NOTSUPP;


Index: mc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mc/devel/mc.spec,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -p -r1.150 -r1.151
--- mc.spec	5 Oct 2009 11:42:16 -0000	1.150
+++ mc.spec	12 Oct 2009 12:50:24 -0000	1.151
@@ -1,7 +1,7 @@
 Summary:	User-friendly text console file manager and visual shell
 Name:		mc
 Version:	4.7.0
-Release:	0.5.pre3%{?dist}
+Release:	0.6.pre3%{?dist}
 Epoch:		1
 License:	GPLv2
 Group:		System Environment/Shells
@@ -14,6 +14,7 @@ Requires:	dev >= 3.3-3
 
 Patch1:		mc-exit.patch
 Patch2:		mc-extensions.patch
+Patch3:		mc-vfsfail.patch
 
 %description
 Midnight Commander is a visual shell much like a file manager, only
@@ -26,6 +27,7 @@ specific files.
 %setup -q -n mc-%{version}-pre3
 %patch1 -p1 -b .exit
 %patch2 -p1 -b .extensions
+%patch3 -p1 -b .vfsfail
 
 %build
 export CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS"
@@ -81,6 +83,9 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{_libexecdir}/mc
 
 %changelog
+* Mon Oct 12 2009 Jindrich Novy <jnovy at redhat.com> 4.7.0-0.6.pre3
+- fix segfault while browsing various archives via VFS (#528268)
+
 * Mon Oct  5 2009 Jindrich Novy <jnovy at redhat.com> 4.7.0-0.5.pre3
 - update to 4.7.0-pre3
 - add BR: gpm-devel




More information about the scm-commits mailing list