Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.01 KB | None | 0 0
  1. From 4e2e1028695415a2bdcccb1b9e39958f1c41f2f2 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
  3. Date: Wed, 7 Dec 2016 15:10:21 +0100
  4. Subject: [PATCH] fix some CVEs for bmp2tiff
  5.  
  6. ---
  7. archive/tools/bmp2tiff.c | 8 ++++++++
  8.  1 file changed, 8 insertions(+)
  9.  
  10. diff --git a/archive/tools/bmp2tiff.c b/archive/tools/bmp2tiff.c
  11. index d541e203..80d4e8bc 100644
  12. --- a/archive/tools/bmp2tiff.c
  13. +++ b/archive/tools/bmp2tiff.c
  14. @@ -770,6 +770,14 @@ main(int argc, char* argv[])
  15.  
  16.             _TIFFfree(comprbuf);
  17.  
  18. +           /* Check whether we are not going to read past the uncompressed data */
  19. +           if ( length > j || width > j || length * width > j) {
  20. +               TIFFError(infilename,
  21. +                                          "Premature end of file");
  22. +               _TIFFfree(uncomprbuf);
  23. +               goto bad3;
  24. +           }
  25. +
  26.             for (row = 0; row < length; row++) {
  27.                 if (TIFFWriteScanline(out,
  28.                                                        uncomprbuf + (length - row - 1) * width,
  29. --
  30. 2.15.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement