From a0164c6ce7c486789073bc3472ebb480d75a5a48 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Mon, 9 Dec 2013 21:11:09 +0000 Subject: [PATCH] Use apr_pstrmemdup instead of apr_pstrndup when this is safe. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1549680 13f79535-47bb-0310-9956-ffa450edef68 --- modules/cache/mod_cache_disk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cache/mod_cache_disk.c b/modules/cache/mod_cache_disk.c index 83bbc01d3b..ddf6431440 100644 --- a/modules/cache/mod_cache_disk.c +++ b/modules/cache/mod_cache_disk.c @@ -381,7 +381,7 @@ static int create_entity(cache_handle_t *h, request_rec *r, const char *key, apr dobj->name = obj->key; dobj->prefix = NULL; /* Save the cache root */ - dobj->root = apr_pstrndup(r->pool, conf->cache_root, conf->cache_root_len); + dobj->root = apr_pstrmemdup(r->pool, conf->cache_root, conf->cache_root_len); dobj->root_len = conf->cache_root_len; apr_pool_create(&pool, r->pool); @@ -441,7 +441,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key) dobj->prefix = NULL; /* Save the cache root */ - dobj->root = apr_pstrndup(r->pool, conf->cache_root, conf->cache_root_len); + dobj->root = apr_pstrmemdup(r->pool, conf->cache_root, conf->cache_root_len); dobj->root_len = conf->cache_root_len; dobj->vary.file = header_file(r->pool, conf, dobj, key); -- 2.40.0