<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From d5fda878455dc3eeab247816c248d333c5cfe84b Mon Sep 17 00:00:00 2001
From: Adam Sampson &lt;ats@offog.org&gt;
Date: Sat, 5 Jul 2025 16:52:17 +0100
Subject: [PATCH 3/4] Avoid strcpy with overlapping arguments

Calling strcpy with two overlapping strings is undefined behaviour. Use
memmove instead.
---
 src/file-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/file-io.c b/src/file-io.c
index d97fbec..c69b800 100644
--- a/src/file-io.c
+++ b/src/file-io.c
@@ -298,7 +298,7 @@ __END_DECLARATIONS
 		    ptr_char = s2 + len + 1;
 		    if (!*ptr_char)
 		      break;
-		    strcpy (s2, ptr_char);
+		    memmove (s2, ptr_char, strlen(ptr_char) + 1);
 		  }
 		/*
 		   If a file isn't found yet but the last character of the
-- 
2.50.0

</pre></body></html>