diff --git a/tiff-CVE-2018-8905.patch b/tiff-CVE-2018-8905.patch new file mode 100644 index 0000000..dc5f046 --- /dev/null +++ b/tiff-CVE-2018-8905.patch @@ -0,0 +1,38 @@ +diff --git a/libtiff/tif_lzw.c b/libtiff/tif_lzw.c +index 4ccb443..94d85e3 100644 +--- a/libtiff/tif_lzw.c ++++ b/libtiff/tif_lzw.c +@@ -602,6 +602,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s) + char *tp; + unsigned char *bp; + int code, nbits; ++ int len; + long nextbits, nextdata, nbitsmask; + code_t *codep, *free_entp, *maxcodep, *oldcodep; + +@@ -753,13 +754,18 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s) + } while (--occ); + break; + } +- assert(occ >= codep->length); +- op += codep->length; +- occ -= codep->length; +- tp = op; ++ len = codep->length; ++ tp = op + len; + do { +- *--tp = codep->value; +- } while( (codep = codep->next) != NULL ); ++ int t; ++ --tp; ++ t = codep->value; ++ codep = codep->next; ++ *tp = (char)t; ++ } while (codep && tp > op); ++ assert(occ >= len); ++ op += len; ++ occ -= len; + } else { + *op++ = (char)code; + occ--; + diff --git a/tiff.changes b/tiff.changes index 82239e5..5a4dd47 100644 --- a/tiff.changes +++ b/tiff.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jun 5 12:21:02 UTC 2018 - pgajdos@suse.com + +- security update + * CVE-2018-8905 [bsc#1086408] + + tiff-CVE-2018-8905.patch + ------------------------------------------------------------------- Mon Jun 4 15:12:15 UTC 2018 - pgajdos@suse.com diff --git a/tiff.spec b/tiff.spec index 7257d46..5818621 100644 --- a/tiff.spec +++ b/tiff.spec @@ -36,6 +36,7 @@ Patch4: tiff-CVE-2018-10963.patch Patch5: tiff-CVE-2017-18013.patch Patch6: tiff-CVE-2018-7456.patch Patch7: tiff-CVE-2017-11613.patch +Patch8: tiff-CVE-2018-8905.patch BuildRequires: gcc-c++ BuildRequires: libjpeg-devel @@ -105,6 +106,7 @@ the libtiff library. %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 %build CFLAGS="%{optflags} -fPIE"