You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

  1. From c7153361a4041260719b340f73f2f76b0969235c Mon Sep 17 00:00:00 2001
  2. From: erouault <erouault>
  3. Date: Tue, 20 Dec 2016 17:28:17 +0000
  4. Subject: [PATCH] * tools/tiff2pdf.c: avoid potential heap-based overflow in
  5. t2p_readwrite_pdf_image_tile(). Fixes
  6. http://bugzilla.maptools.org/show_bug.cgi?id=2640
  7. ---
  8. ChangeLog | 6 ++++++
  9. tools/tiff2pdf.c | 2 +-
  10. 2 files changed, 7 insertions(+), 1 deletion(-)
  11. diff --git a/ChangeLog b/ChangeLog
  12. index 6be3602..91ba4e6 100644
  13. --- a/ChangeLog
  14. +++ b/ChangeLog
  15. @@ -1,3 +1,9 @@
  16. +2016-12-20 Even Rouault <even.rouault at spatialys.com>
  17. +
  18. + * tools/tiff2pdf.c: avoid potential heap-based overflow in
  19. + t2p_readwrite_pdf_image_tile().
  20. + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2640
  21. +
  22. 2016-12-13 Even Rouault <even.rouault at spatialys.com>
  23. * libtiff/tif_fax3.h: revert change done on 2016-01-09 that made
  24. diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
  25. index 47d7629..db196e0 100644
  26. --- a/tools/tiff2pdf.c
  27. +++ b/tools/tiff2pdf.c
  28. @@ -2895,7 +2895,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P
  29. return(0);
  30. }
  31. if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0) {
  32. - if (count >= 4) {
  33. + if (count > 4) {
  34. /* Ignore EOI marker of JpegTables */
  35. _TIFFmemcpy(buffer, jpt, count - 2);
  36. bufferoffset += count - 2;