summaryrefslogtreecommitdiff
path: root/encoding
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2014-11-27 14:26:03 +0000
committerRuediger Pluem <rpluem@apache.org>2014-11-27 14:26:03 +0000
commit5cdd98737adfa976fa988005e5616957c1512c19 (patch)
tree720297736ce99ab3fcad43c2e48d1fb31b67335f /encoding
parent21dde2ad87cdcd231b2c1354c5750fc71db33283 (diff)
downloadapr-5cdd98737adfa976fa988005e5616957c1512c19.tar.gz
* Correctly calculate the size of the returned string and set the correct
return value in case we actually escape the string. PR: 57230 Submitted by: <aduryagin gmail.com> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1642159 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'encoding')
-rw-r--r--encoding/apr_escape.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c
index eda467593..3be9eb99e 100644
--- a/encoding/apr_escape.c
+++ b/encoding/apr_escape.c
@@ -436,6 +436,8 @@ APR_DECLARE(apr_status_t) apr_escape_path(char *escaped, const char *path,
while ((c = *s) && slen) {
if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) {
d = c2x(c, '%', d);
+ size += 2;
+ found = 1;
}
else {
*d++ = c;