libtiff: Merge branch 'fix_coverity_test_directory_expansion' into 'master'

From e79965bbe70525f2609b1805f203c2df8dd47de1 Mon Sep 17 00:00:00 2001
From: Su_Laus <[EMAIL REDACTED]>
Date: Tue, 2 Apr 2024 21:56:21 +0200
Subject: [PATCH] Fix coverity scan issue in test_directory.c

---
 test/test_directory.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/test_directory.c b/test/test_directory.c
index 9dc589ec..b8ba8d2f 100644
--- a/test/test_directory.c
+++ b/test/test_directory.c
@@ -135,8 +135,8 @@ int write_directory_to_closed_file(const char *filename, unsigned int openMode,
 {
     TIFF *tif;
     /* Replace 'w' for write by 'a' for append. */
-    char strAux[8];
-    strncpy(strAux, openModeStrings[openMode], sizeof(strAux));
+    char strAux[8] = {0};
+    strncpy(strAux, openModeStrings[openMode], sizeof(strAux) - 1);
     strAux[0] = 'a';
     tif = TIFFOpen(filename, strAux);
     if (!tif)