gnu: gnucash: Disable the stress-options-test using a phase.
[jackhill/guix/guix.git] / gnu / packages / patches / libtiff-CVE-2017-18013.patch
1 Fix CVE-2017-18013:
2
3 http://bugzilla.maptools.org/show_bug.cgi?id=2770
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-18013
5
6 Patch copied from upstream source repository:
7
8 https://gitlab.com/libtiff/libtiff/commit/c6f41df7b581402dfba3c19a1e3df4454c551a01
9
10 From c6f41df7b581402dfba3c19a1e3df4454c551a01 Mon Sep 17 00:00:00 2001
11 From: Even Rouault <even.rouault@spatialys.com>
12 Date: Sun, 31 Dec 2017 15:09:41 +0100
13 Subject: [PATCH] libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer
14 dereference on corrupted file. Fixes
15 http://bugzilla.maptools.org/show_bug.cgi?id=2770
16
17 ---
18 libtiff/tif_print.c | 8 ++++----
19 1 file changed, 4 insertions(+), 4 deletions(-)
20
21 diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c
22 index 9959d353..8deceb2b 100644
23 --- a/libtiff/tif_print.c
24 +++ b/libtiff/tif_print.c
25 @@ -665,13 +665,13 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
26 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
27 fprintf(fd, " %3lu: [%8I64u, %8I64u]\n",
28 (unsigned long) s,
29 - (unsigned __int64) td->td_stripoffset[s],
30 - (unsigned __int64) td->td_stripbytecount[s]);
31 + td->td_stripoffset ? (unsigned __int64) td->td_stripoffset[s] : 0,
32 + td->td_stripbytecount ? (unsigned __int64) td->td_stripbytecount[s] : 0);
33 #else
34 fprintf(fd, " %3lu: [%8llu, %8llu]\n",
35 (unsigned long) s,
36 - (unsigned long long) td->td_stripoffset[s],
37 - (unsigned long long) td->td_stripbytecount[s]);
38 + td->td_stripoffset ? (unsigned long long) td->td_stripoffset[s] : 0,
39 + td->td_stripbytecount ? (unsigned long long) td->td_stripbytecount[s] : 0);
40 #endif
41 }
42 }
43 --
44 2.16.1
45