From: Jeff Trawick Date: Mon, 18 Nov 2002 14:13:53 +0000 (+0000) Subject: use memcpy() instead of strncpy() since strncpy() is more expensive but X-Git-Tag: 2.0.44~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26f1f5a040f0ded7699648d6209014b1793a38cb;p=apache use memcpy() instead of strncpy() since strncpy() is more expensive but none of its extra function is needed git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97562 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 93392a0e4f..28e7aa5598 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -809,7 +809,11 @@ static apr_off_t get_body(char *buffer, apr_size_t *len, const char *tag, return -1; } - strncpy(buffer + *len, tag, taglen); + /* put a copy of the tag *after* the data read from the file + * so that strstr() will find something with no reliance on + * terminating '\0' + */ + memcpy(buffer + *len, tag, taglen); endbody = strstr(buffer, tag); if (endbody == buffer + *len) { return -1;