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

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