File tiff-CVE-2023-2908.patch of Package tiff.34105
Index: tiff-4.0.9/libtiff/tif_dir.c
===================================================================
--- tiff-4.0.9.orig/libtiff/tif_dir.c
+++ tiff-4.0.9/libtiff/tif_dir.c
@@ -133,10 +133,10 @@ static uint16
countInkNamesString(TIFF *tif, uint32 slen, const char *s)
{
uint16 i = 0;
- const char *ep = s + slen;
- const char *cp = s;
if (slen > 0) {
+ const char *ep = s + slen;
+ const char *cp = s;
do {
for (; cp < ep && *cp != '\0'; cp++) {}
if (cp >= ep)