File: 0135-xscanimage_c-out-of-bounds.patch

package info (click to toggle)
sane-frontends 1.0.14-18.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,780 kB
  • sloc: ansic: 13,516; sh: 2,703; makefile: 466
file content (19 lines) | stat: -rw-r--r-- 822 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: Correct out-of-bounds
Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
Forwarded: not-needed
Last-Update: 2014-12-03
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: trunk/src/xscanimage.c
===================================================================
--- trunk.orig/src/xscanimage.c
+++ trunk/src/xscanimage.c
@@ -1284,7 +1284,7 @@ scan_dialog (GtkWidget * widget, gpointe
     {				/* We are running in standalone mode */
       /* test for pnm formats */
       strncpy (testfilename, preferences.filename, sizeof (testfilename));
-      testfilename[sizeof (testfilename)] = 0;
+      testfilename[sizeof (testfilename) - 1] = 0;
       g_strreverse (testfilename);
       if (!((!strncmp (testfilename, "mnp.", 4)) ||
 	    (!strncmp (testfilename, "mgp.", 4)) ||