sane-frontends-1.0.14-array-out-of-bounds.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. commit c4cb247732767aed76502069d0b3040c4c4e5123
  2. Author: Nils Philippsen <nils@redhat.com>
  3. Date: Fri Jul 31 16:21:53 2009 +0200
  4. patch: array-out-of-bounds
  5. Squashed commit of the following:
  6. commit 337bcefaa7a67931095b74317a266a1244978ab6
  7. Author: Nils Philippsen <nils@redhat.com>
  8. Date: Fri Jul 31 16:03:28 2009 +0200
  9. fix array subscript out of bounds errors (#133121)
  10. diff --git a/src/xcam.c b/src/xcam.c
  11. index 2d494a5..f6859b7 100644
  12. --- a/src/xcam.c
  13. +++ b/src/xcam.c
  14. @@ -1289,7 +1289,7 @@ save_frame_button (GtkWidget * widget, gpointer client_data,
  15. /* test for pnm formats */
  16. strncpy (testfilename, preferences.filename, sizeof (testfilename));
  17. - testfilename[sizeof (testfilename)] = 0;
  18. + testfilename[sizeof (testfilename) - 1] = 0;
  19. g_strreverse (testfilename);
  20. if (!((!strncmp (testfilename, "mnp.", 4)) ||
  21. (!strncmp (testfilename, "mgp.", 4)) ||
  22. diff --git a/src/xscanimage.c b/src/xscanimage.c
  23. index a36324f..065923d 100644
  24. --- a/src/xscanimage.c
  25. +++ b/src/xscanimage.c
  26. @@ -1284,7 +1284,7 @@ scan_dialog (GtkWidget * widget, gpointer call_data)
  27. { /* We are running in standalone mode */
  28. /* test for pnm formats */
  29. strncpy (testfilename, preferences.filename, sizeof (testfilename));
  30. - testfilename[sizeof (testfilename)] = 0;
  31. + testfilename[sizeof (testfilename) - 1] = 0;
  32. g_strreverse (testfilename);
  33. if (!((!strncmp (testfilename, "mnp.", 4)) ||
  34. (!strncmp (testfilename, "mgp.", 4)) ||