2022-11-08 06:48:26 +00:00
|
|
|
From 142912f9f5bce169d9d0b16a687c00f9edec5825 Mon Sep 17 00:00:00 2001
|
2019-05-07 12:00:01 +00:00
|
|
|
From: Even Rouault <even.rouault@spatialys.com>
|
|
|
|
Date: Sat, 12 May 2018 14:24:15 +0200
|
2022-11-08 06:48:26 +00:00
|
|
|
Subject: [PATCH] (CVE-2018-10963) TIFFWriteDirectorySec: avoid assertion.
|
|
|
|
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2795. CVE-2018-10963
|
2019-05-07 12:00:01 +00:00
|
|
|
|
2022-11-08 06:48:26 +00:00
|
|
|
(cherry picked from commit de144fd228e4be8aa484c3caf3d814b6fa88c6d9)
|
2019-05-07 12:00:01 +00:00
|
|
|
---
|
|
|
|
libtiff/tif_dirwrite.c | 7 +++++--
|
|
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c
|
2022-11-08 06:48:26 +00:00
|
|
|
index c68d6d21..5d0a6699 100644
|
2019-05-07 12:00:01 +00:00
|
|
|
--- a/libtiff/tif_dirwrite.c
|
|
|
|
+++ b/libtiff/tif_dirwrite.c
|
|
|
|
@@ -697,8 +697,11 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
- assert(0); /* we should never get here */
|
|
|
|
- break;
|
|
|
|
+ TIFFErrorExt(tif->tif_clientdata,module,
|
|
|
|
+ "Cannot write tag %d (%s)",
|
|
|
|
+ TIFFFieldTag(o),
|
|
|
|
+ o->field_name ? o->field_name : "unknown");
|
|
|
|
+ goto bad;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|