]> granicus.if.org Git - apache/commitdiff
ap_sub_req_lookup_dirent() depends on the over-allocation done by
authorStefan Fritsch <sf@apache.org>
Fri, 14 Sep 2012 21:06:05 +0000 (21:06 +0000)
committerStefan Fritsch <sf@apache.org>
Fri, 14 Sep 2012 21:06:05 +0000 (21:06 +0000)
ap_make_full_path and ap_escape_uri, so let's document it so that it is not
accidentally removed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1384924 13f79535-47bb-0310-9956-ffa450edef68

include/httpd.h
server/request.c

index da181d4d4aa7927aba39f1414289b2ac37c71220..9f3fea9bb64dd592e890bb52aef0d7f441e8d8cd 100644 (file)
@@ -1579,7 +1579,9 @@ AP_DECLARE(char *) ap_escape_path_segment_buffer(char *c, const char *s);
  * @param p The pool to allocate from
  * @param path The path to convert
  * @param partial if set, assume that the path will be appended to something
- *        with a '/' in it (and thus does not prefix "./")
+ *        with a '/' in it (and thus does not prefix "./").
+ *        If not set, there will be one byte of additional space after the
+ *        NUL, to allow the caller to append a '/'.
  * @return The converted URL
  */
 AP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial);
@@ -1692,7 +1694,8 @@ AP_DECLARE(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s);
  * @param a The pool to allocate from
  * @param dir The directory name
  * @param f The filename
- * @return A copy of the full path
+ * @return A copy of the full path, with one byte of extra space after the NUL
+ *         to allow the caller to add a trailing '/'.
  * @note Never consider using this function if you are dealing with filesystem
  * names that need to remain canonical, unless you are merging an apr_dir_read
  * path and returned filename.  Otherwise, the result is not canonical.
index 4abe99ca76ba833b9f49929ce7764b648eba4c8e..a6fb1cb11bf9b2dffe0bae1d39cdee5b4c7812af 100644 (file)
@@ -2160,7 +2160,7 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent,
     }
 
     if (rnew->finfo.filetype == APR_DIR) {
-        /* ap_make_full_path overallocated the buffers
+        /* ap_make_full_path and ap_escape_uri overallocated the buffers
          * by one character to help us out here.
          */
         strcat(rnew->filename, "/");