From: Christophe Jaillet Date: Mon, 9 Dec 2013 20:52:26 +0000 (+0000) Subject: Use apr_pstrmemdup instead of apr_pstrndup when this is safe. X-Git-Tag: 2.5.0-alpha~4789 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a95a9fc800df773a6750353122b04ab330f74279;p=apache Use apr_pstrmemdup instead of apr_pstrndup when this is safe. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1549676 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cluster/mod_heartmonitor.c b/modules/cluster/mod_heartmonitor.c index 8e4231dc37..b3d666ba22 100644 --- a/modules/cluster/mod_heartmonitor.c +++ b/modules/cluster/mod_heartmonitor.c @@ -292,7 +292,7 @@ static apr_status_t hm_file_update_stat(hm_ctx_t *ctx, hm_server_t *s, apr_pool_ buf[bsize - 1] = 0; t = strchr(buf, ' '); if (t) { - ip = apr_pstrndup(pool, buf, t - buf); + ip = apr_pstrmemdup(pool, buf, t - buf); } else { ip = NULL; } diff --git a/modules/proxy/balancers/mod_lbmethod_heartbeat.c b/modules/proxy/balancers/mod_lbmethod_heartbeat.c index 77fb994ff1..e9e1034405 100644 --- a/modules/proxy/balancers/mod_lbmethod_heartbeat.c +++ b/modules/proxy/balancers/mod_lbmethod_heartbeat.c @@ -162,7 +162,7 @@ static apr_status_t readfile_heartbeats(const char *path, apr_hash_t *servers, continue; } - ip = apr_pstrndup(pool, buf, t - buf); + ip = apr_pstrmemdup(pool, buf, t - buf); t++; server = apr_hash_get(servers, ip, APR_HASH_KEY_STRING);