From: Takashi Sato Date: Thu, 18 Dec 2008 17:51:18 +0000 (+0000) Subject: Use apr_cpystrn instead of strncpy since strncpy can create an unterminated string. X-Git-Tag: 2.3.1~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f2cf8d6e5d2131bb31f6126f40c986020e1a711b;p=thirdparty%2Fapache%2Fhttpd.git Use apr_cpystrn instead of strncpy since strncpy can create an unterminated string. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@727777 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_fdpass.c b/modules/proxy/mod_proxy_fdpass.c index a59d3c0ce13..cf66579d07c 100644 --- a/modules/proxy/mod_proxy_fdpass.c +++ b/modules/proxy/mod_proxy_fdpass.c @@ -104,7 +104,7 @@ static apr_status_t get_socket_from_path(apr_pool_t *p, } sa.sun_family = AF_UNIX; - strncpy(sa.sun_path, path, sizeof(sa.sun_path)); + apr_cpystrn(sa.sun_path, path, sizeof(sa.sun_path)); rv = socket_connect_un(s, &sa); if (rv) {