From: Christophe Jaillet Date: Mon, 20 Jun 2016 21:08:43 +0000 (+0000) Subject: Use 'memcpy' instead of 'strcpy' when the size of the string has already been computed. X-Git-Tag: 2.5.0-alpha~1489 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=045ddad34ddeeb2e3ce26563c7ce7208e55b83d0;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/modules/filters/sed1.c b/modules/filters/sed1.c index ed7a5ffe1e8..be035067885 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; }