From: William A. Rowe Jr Date: Fri, 1 Nov 2002 03:27:20 +0000 (+0000) Subject: Fix a trailing slash/last filename truncation bug observed on Linux, X-Git-Tag: 2.0.44~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22c4e6219fe3a2296ce0a7fcbdc830d68c320b16;p=thirdparty%2Fapache%2Fhttpd.git Fix a trailing slash/last filename truncation bug observed on Linux, which affected DAV MOVE operations and even general file access. PR 14147, 10687, 10236 [Dan Good ] I'm accepting Jeff Trawick's suggestion of twisting the test into an assert, since it seems very unlikely (after correctly resetting the flag) that this will fault. Reviewed by: Jeff Trawick, Will Rowe git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97366 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/request.c b/server/request.c index 73ff7ff7c49..33e55087f64 100644 --- a/server/request.c +++ b/server/request.c @@ -924,6 +924,8 @@ minimerge2: /* That temporary trailing slash was useful, now drop it. */ if (temp_slash) { + temp_slash = 0; + AP_ASSERT(r->filename[filename_len-1] == '/'); r->filename[--filename_len] = '\0'; }