rpms/xsane/F-13 xsane-0.997-no-file-selected.patch, NONE, 1.1 xsane.spec, 1.79, 1.80

Nils Philippsen nphilipp at fedoraproject.org
Mon Jun 28 09:10:17 UTC 2010


Author: nphilipp

Update of /cvs/pkgs/rpms/xsane/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv19994

Modified Files:
	xsane.spec 
Added Files:
	xsane-0.997-no-file-selected.patch 
Log Message:
don't crash if no files are selected (#608047)

xsane-0.997-no-file-selected.patch:
 xsane-back-gtk.c  |   15 +++++++++++----
 xsane-front-gtk.c |    6 +++++-
 2 files changed, 16 insertions(+), 5 deletions(-)

--- NEW FILE xsane-0.997-no-file-selected.patch ---
diff -up xsane-0.997/src/xsane-back-gtk.c.no-file-selected xsane-0.997/src/xsane-back-gtk.c
--- xsane-0.997/src/xsane-back-gtk.c.no-file-selected	2002-10-02 13:05:52.000000000 +0200
+++ xsane-0.997/src/xsane-back-gtk.c	2010-06-28 10:49:29.302391248 +0200
@@ -1501,12 +1501,19 @@ int xsane_back_gtk_get_filename(const ch
 #endif
 
     chooser_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filechooser));
-    strncpy(filename, chooser_filename, max_len - 1);
-    g_free(chooser_filename);
+    if (chooser_filename)
+    {
+      strncpy(filename, chooser_filename, max_len - 1);
+      g_free(chooser_filename);
 
-    filename[max_len - 1] = '\0';
+      filename[max_len - 1] = '\0';
 
-    ok = TRUE;
+      ok = TRUE;
+    }
+    else
+    {
+      ok = FALSE;
+    }
   }
 
   gtk_widget_destroy(filechooser);
diff -up xsane-0.997/src/xsane-front-gtk.c.no-file-selected xsane-0.997/src/xsane-front-gtk.c
--- xsane-0.997/src/xsane-front-gtk.c.no-file-selected	2002-10-02 13:04:33.000000000 +0200
+++ xsane-0.997/src/xsane-front-gtk.c	2010-06-28 10:46:31.025142803 +0200
@@ -1339,7 +1339,11 @@ static void xsane_browse_filename_callba
   snprintf(windowname, sizeof(windowname), "%s %s %s", xsane.prog_name, WINDOW_OUTPUT_FILENAME, xsane.device_text);
 
   umask((mode_t) preferences.directory_umask); /* define new file permissions */    
-  xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, &preferences.filetype, &preferences.cms_function, XSANE_FILE_CHOOSER_ACTION_SELECT_SAVE, show_extra_widgets, XSANE_FILE_FILTER_ALL | XSANE_FILE_FILTER_IMAGES, XSANE_FILE_FILTER_IMAGES);
+  if (!xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, &preferences.filetype, &preferences.cms_function, XSANE_FILE_CHOOSER_ACTION_SELECT_SAVE, show_extra_widgets, XSANE_FILE_FILTER_ALL | XSANE_FILE_FILTER_IMAGES, XSANE_FILE_FILTER_IMAGES))
+  {
+    xsane_set_sensitivity(TRUE);
+    return;
+  }
   umask(XSANE_DEFAULT_UMASK); /* define new file permissions */    
 
   if (preferences.filename)


Index: xsane.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xsane/F-13/xsane.spec,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -p -r1.79 -r1.80
--- xsane.spec	24 Jun 2010 09:17:10 -0000	1.79
+++ xsane.spec	28 Jun 2010 09:10:17 -0000	1.80
@@ -6,7 +6,7 @@
 Name: xsane
 Summary: X Window System front-end for the SANE scanner interface
 Version: 0.997
-Release: 5%{?dist}
+Release: 6%{?dist}
 Source0: http://www.xsane.org/download/%{name}-%{version}.tar.gz
 Source1: xsane.desktop
 # distro-specific: use "xdg-open" instead of "netscape" to launch help browser
@@ -19,6 +19,9 @@ Patch2: xsane-0.996-no-eula.patch
 # enable off-root building
 # submitted to upstream (Oliver Rauch) via email, 2010-06-23
 Patch3: xsane-0.997-off-root-build.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=608047
+# submitted to upstream (Oliver Rauch) via email, 2010-06-28
+Patch4: xsane-0.997-no-file-selected.patch
 # autoconf-generated files
 Patch10: xsane-0.997-5-autoconf.patch.bz2
 License: GPLv2+
@@ -73,6 +76,8 @@ done
 %patch1 -p1 -b .close-fds
 %patch2 -p1 -b .no-eula
 %patch3 -p1 -b .off-root-build
+%patch4 -p1 -b .no-file-selected
+
 %patch10 -p1 -b .autoconf
 
 # in-root config.h breaks off-root building
@@ -144,6 +149,9 @@ fi
 %{_datadir}/sane/xsane
 
 %changelog
+* Mon Jun 28 2010 Nils Philippsen <nils at redhat.com> 0.997-6
+- don't crash if no files are selected (#608047)
+
 * Wed Jun 23 2010 Nils Philippsen <nils at redhat.com> 0.997-5
 - don't use gimp-plugin-mgr anymore
 - use off-root builds



More information about the scm-commits mailing list