File apache2-CVE-2023-31122.patch of Package apache2.34694
Index: httpd-2.4.23/modules/core/mod_macro.c
===================================================================
--- httpd-2.4.23.orig/modules/core/mod_macro.c
+++ httpd-2.4.23/modules/core/mod_macro.c
@@ -465,7 +465,7 @@ static const char *process_content(apr_p
for (i = 0; i < contents->nelts; i++) {
const char *errmsg;
/* copy the line and subtitute macro parameters */
- strncpy(line, ((char **) contents->elts)[i], MAX_STRING_LEN - 1);
+ apr_cpystrn(line, ((char **) contents->elts)[i], MAX_STRING_LEN);
errmsg = substitute_macro_args(line, MAX_STRING_LEN,
macro, replacements, used);
if (errmsg) {