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

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