From: William A. Rowe Jr Date: Sun, 27 Jan 2002 07:49:05 +0000 (+0000) Subject: Whoops - this patch is required by the last request.c change. X-Git-Tag: 2.0.31~72 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c05415a4135ea20564c2c44418ef6f64756b0576;p=apache Whoops - this patch is required by the last request.c change. Fulfills Brian Pane's suggestion that we always overallocate by one to make /foo/bar quickly convertable to /foo/bar/ git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93047 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/util.c b/server/util.c index beda6b4390..2fe95d1fe7 100644 --- a/server/util.c +++ b/server/util.c @@ -1703,7 +1703,10 @@ AP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *src1, len1 = strlen(src1); len2 = strlen(src2); - path = (char *)apr_palloc(a, len1 + len2 + 2); /* +2 for '/' plus null */ + /* allocate +3 for '/' delimiter, trailing NULL and overallocate + * one extra byte to allow the caller to add a trailing '/' + */ + path = (char *)apr_palloc(a, len1 + len2 + 3); if (len1 == 0) { *path = '/'; memcpy(path + 1, src2, len2 + 1);