summaryrefslogtreecommitdiff
path: root/modules/cache
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2019-03-28 18:22:23 +0000
committerYann Ylavic <ylavic@apache.org>2019-03-28 18:22:23 +0000
commitf2a066e584a9f8cb5be326f4e3afe2da53375982 (patch)
treeb8fd5e2000198f5735565ae327b047afc3d70531 /modules/cache
parent00bd49eaa54603163d43531b9571cafc7ae74ee0 (diff)
downloadhttpd-f2a066e584a9f8cb5be326f4e3afe2da53375982.tar.gz
mod_cache: follow up to r1856493: always terminate cache_strqtok() returns.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1856500 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/cache')
-rw-r--r--modules/cache/cache_util.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c
index 2c5a30734a..ae00c10c8f 100644
--- a/modules/cache/cache_util.c
+++ b/modules/cache/cache_util.c
@@ -931,6 +931,7 @@ CACHE_DECLARE(char *)ap_cache_generate_name(apr_pool_t *p, int dirlevels,
apr_status_t cache_strqtok(char *str, char **token, char **arg, char **last)
{
#define CACHE_TOKEN_SEPS "\t ,"
+ apr_status_t rv = APR_SUCCESS;
int quoted = 0;
char *wpos;
@@ -988,7 +989,6 @@ apr_status_t cache_strqtok(char *str, char **token, char **arg, char **last)
}
*wpos++ = *str;
}
- *wpos = '\0';
/* anything after should be trailing OWS or comma */
for (; *str; ++str) {
@@ -997,12 +997,14 @@ apr_status_t cache_strqtok(char *str, char **token, char **arg, char **last)
break;
}
if (*str != '\t' && *str != ' ') {
- return APR_EINVAL;
+ rv = APR_EINVAL;
+ break;
}
}
- *last = str;
- return APR_SUCCESS;
+ *wpos = '\0';
+ *last = str;
+ return rv;
}
/**