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

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