forked from mindspore-Ecosystem/mindspore
!31655 fix CVE-2022-0908
Merge pull request !31655 from shenwei41/libtiff
This commit is contained in:
commit
a9a0b7883c
|
@ -30,6 +30,7 @@ mindspore_add_pkg(tiff
|
|||
MD5 ${MD5}
|
||||
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -Djbig=OFF -Dlzma=OFF -Djpeg12=OFF -Dzstd=OFF -Dpixarlog=OFF
|
||||
-Dold-jpeg=OFF -Dwebp=OFF -DBUILD_SHARED_LIBS=OFF -Dlibdeflate=OFF
|
||||
PATCHES ${TOP_DIR}/third_party/patch/libtiff/CVE-2022-0561_and_CVE-2022-0562.patch001)
|
||||
PATCHES ${TOP_DIR}/third_party/patch/libtiff/CVE-2022-0561_and_CVE-2022-0562.patch001
|
||||
PATCHES ${TOP_DIR}/third_party/patch/libtiff/CVE-2022-0908.patch002)
|
||||
message("tiff include = ${tiff_INC}")
|
||||
message("tiff lib = ${tiff_LIB}")
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
diff -Npur libtiff-v4.2.0/libtiff/tif_dirread.c libtiff-v4.2.0-change/libtiff/tif_dirread.c
|
||||
--- libtiff-v4.2.0/libtiff/tif_dirread.c 2020-12-20 02:44:58.000000000 +0800
|
||||
+++ libtiff-v4.2.0-change/libtiff/tif_dirread.c 2022-03-21 19:27:48.016570736 +0800
|
||||
@@ -5079,7 +5079,10 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEnt
|
||||
_TIFFfree(data);
|
||||
return(0);
|
||||
}
|
||||
- _TIFFmemcpy(o,data,(uint32)dp->tdir_count);
|
||||
+ if (dp->tdir_count > 0 )
|
||||
+ {
|
||||
+ _TIFFmemcpy(o,data,(uint32)dp->tdir_count);
|
||||
+ }
|
||||
o[(uint32)dp->tdir_count]=0;
|
||||
if (data!=0)
|
||||
_TIFFfree(data);
|
Loading…
Reference in New Issue