We need to allocate storage space for the terminating NULL AND the extra /
we may tack on to the string at some point.
How in the hell the stars were aligned for this to corrupt newv via the
strcat at line 580 is unknown.
Resolves segfault seen on daedalus.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91607
13f79535-47bb-0310-9956-
ffa450edef68
rv = apr_filepath_root((const char **)&r->filename,
(const char **)&r->path_info,
APR_FILEPATH_TRUENAME, r->pool);
- buflen = strlen(r->filename) + strlen(r->path_info) + 1;
+ /* Space for terminating null and an extra / is required. */
+ buflen = strlen(r->filename) + strlen(r->path_info) + 2;
buf = apr_palloc(r->pool, buflen);
strcpy (buf, r->filename);
r->filename = buf;