]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Use 'memcpy' instead of 'strcpy' when the size of the string has already been computed.
authorChristophe Jaillet <jailletc36@apache.org>
Mon, 20 Jun 2016 21:08:43 +0000 (21:08 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Mon, 20 Jun 2016 21:08:43 +0000 (21:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1749403 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/sed1.c

index ed7a5ffe1e8bed89f8be69f75c42892bb4ef0e82..be0350678856fb83db6d9df8af0bc16dfa9f3abf 100644 (file)
@@ -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;
 }