Blame SOURCES/sane-frontends-1.0.14-array-out-of-bounds.patch

8956ca
commit c4cb247732767aed76502069d0b3040c4c4e5123
8956ca
Author: Nils Philippsen <nils@redhat.com>
8956ca
Date:   Fri Jul 31 16:21:53 2009 +0200
8956ca
8956ca
    patch: array-out-of-bounds
8956ca
    
8956ca
    Squashed commit of the following:
8956ca
    
8956ca
    commit 337bcefaa7a67931095b74317a266a1244978ab6
8956ca
    Author: Nils Philippsen <nils@redhat.com>
8956ca
    Date:   Fri Jul 31 16:03:28 2009 +0200
8956ca
    
8956ca
        fix array subscript out of bounds errors (#133121)
8956ca
8956ca
diff --git a/src/xcam.c b/src/xcam.c
8956ca
index 2d494a5..f6859b7 100644
8956ca
--- a/src/xcam.c
8956ca
+++ b/src/xcam.c
8956ca
@@ -1289,7 +1289,7 @@ save_frame_button (GtkWidget * widget, gpointer client_data,
8956ca
 
8956ca
       /* test for pnm formats */
8956ca
       strncpy (testfilename, preferences.filename, sizeof (testfilename));
8956ca
-      testfilename[sizeof (testfilename)] = 0;
8956ca
+      testfilename[sizeof (testfilename) - 1] = 0;
8956ca
       g_strreverse (testfilename);
8956ca
       if (!((!strncmp (testfilename, "mnp.", 4)) ||
8956ca
 	    (!strncmp (testfilename, "mgp.", 4)) ||
8956ca
diff --git a/src/xscanimage.c b/src/xscanimage.c
8956ca
index a36324f..065923d 100644
8956ca
--- a/src/xscanimage.c
8956ca
+++ b/src/xscanimage.c
8956ca
@@ -1284,7 +1284,7 @@ scan_dialog (GtkWidget * widget, gpointer call_data)
8956ca
     {				/* We are running in standalone mode */
8956ca
       /* test for pnm formats */
8956ca
       strncpy (testfilename, preferences.filename, sizeof (testfilename));
8956ca
-      testfilename[sizeof (testfilename)] = 0;
8956ca
+      testfilename[sizeof (testfilename) - 1] = 0;
8956ca
       g_strreverse (testfilename);
8956ca
       if (!((!strncmp (testfilename, "mnp.", 4)) ||
8956ca
 	    (!strncmp (testfilename, "mgp.", 4)) ||