patch-af 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. $NetBSD: patch-af,v 1.1 2005/10/30 17:58:58 salo Exp $
  2. Security fix for CVE-2005-3178, from Debian.
  3. --- zoom.c.orig 2005-02-28 01:42:39.000000000 +0100
  4. +++ zoom.c 2005-10-30 18:50:04.000000000 +0100
  5. @@ -52,28 +52,29 @@
  6. if (verbose)
  7. printf(" Zooming image Y axis by %d%%...", yzoom);
  8. if (changetitle)
  9. - sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom);
  10. + snprintf(buf, BUFSIZ, "%s (Y zoom %d%%)", oimage->title, yzoom);
  11. }
  12. else if (!yzoom) {
  13. if (verbose)
  14. printf(" Zooming image X axis by %d%%...", xzoom);
  15. if (changetitle)
  16. - sprintf(buf, "%s (X zoom %d%%)", oimage->title, xzoom);
  17. + snprintf(buf, BUFSIZ, "%s (X zoom %d%%)", oimage->title, xzoom);
  18. }
  19. else if (xzoom == yzoom) {
  20. if (verbose)
  21. printf(" Zooming image by %d%%...", xzoom);
  22. if (changetitle)
  23. - sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
  24. + snprintf(buf, BUFSIZ, "%s (%d%% zoom)", oimage->title, xzoom);
  25. }
  26. else {
  27. if (verbose)
  28. printf(" Zooming image X axis by %d%% and Y axis by %d%%...",
  29. xzoom, yzoom);
  30. if (changetitle)
  31. - sprintf(buf, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
  32. + snprintf(buf, BUFSIZ, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
  33. xzoom, yzoom);
  34. }
  35. + buf[BUFSIZ-1] = '\0';
  36. if (!changetitle)
  37. strcpy(buf,oimage->title);