From 045ddad34ddeeb2e3ce26563c7ce7208e55b83d0 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Mon, 20 Jun 2016 21:08:43 +0000 Subject: [PATCH] Use 'memcpy' instead of 'strcpy' when the size of the string has already been computed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1749403 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/sed1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/filters/sed1.c b/modules/filters/sed1.c index ed7a5ffe1e..be03506788 100644 --- a/modules/filters/sed1.c +++ b/modules/filters/sed1.c @@ -196,7 +196,7 @@ static void append_to_holdbuf(sed_eval_t *eval, const char* sz) if (eval->hsize <= reqsize) { grow_hold_buffer(eval, reqsize); } - strcpy(eval->hspend, sz); + memcpy(eval->hspend, sz, len + 1); /* hspend will now point to NULL character */ eval->hspend += len; } @@ -220,7 +220,7 @@ static void append_to_genbuf(sed_eval_t *eval, const char* sz, char **gspend) if (eval->gsize < reqsize) { grow_gen_buffer(eval, reqsize, gspend); } - strcpy(*gspend, sz); + memcpy(*gspend, sz, len + 1); /* *gspend will now point to NULL character */ *gspend += len; } -- 2.50.1