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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2fef71366b200297363b2b4ba8afb115f9dcda2;p=thirdparty%2Fapache%2Fhttpd.git 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 93392a0e4f9..28e7aa5598e 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;