From bda11dca2561d937f0452d710a0c6755e9b92c6d Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Mon, 2 Jan 2023 13:08:28 +0100
Subject: [PATCH 4/6] Fix warning about possible string truncation

This is a false positive, since the source is an 8-byte hash and
is copied into an 8-byte substring. memcpy is a better fit anyway.
---
 src/sslutils/evaluate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sslutils/evaluate.c b/src/sslutils/evaluate.c
index 09b8ba4..9c03fdc 100644
--- a/src/sslutils/evaluate.c
+++ b/src/sslutils/evaluate.c
@@ -353,8 +353,8 @@ void PRIVATE read_pathrestriction(STACK_OF(X509) *chain, char *path,
     hash = gethash(cert, hashed);
 
     /* Determine file names */
-    strncpy(signing + 1, hash, 8);
-    strncpy(namespace + 1, hash, 8);
+    memcpy(signing + 1, hash, 8);
+    memcpy(namespace + 1, hash, 8);
 
     file = open_from_dir(path, signing);
     if (file) {
-- 
2.38.1

