]> granicus.if.org Git - apache/commitdiff
Whoops - this patch is required by the last request.c change.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 27 Jan 2002 07:49:05 +0000 (07:49 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 27 Jan 2002 07:49:05 +0000 (07:49 +0000)
  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

server/util.c

index beda6b43903a9f18e36aeaa6732c2af542e69688..2fe95d1fe727fd3f3ab733f21c901a1faab0b83d 100644 (file)
@@ -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);