httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 14147] - patch for filename truncation bug in ap_directory_walk
Date Fri, 01 Nov 2002 03:40:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14147>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14147

patch for filename truncation bug in ap_directory_walk





------- Additional Comments From wrowe@apache.org  2002-11-01 03:40 -------

  Still makes no sense.

        do {
            int res;
            char *seg_name;
            char *delim;
            int temp_slash=0;

            /* We have no trailing slash, but we sure would appreciate one.
             * However, we don't want to append a / our first time through.
             */
            if ((seg > startseg) && r->filename[filename_len-1] != '/') {
                r->filename[filename_len++] = '/';
                r->filename[filename_len] = 0;
                temp_slash=1;
            }
[...]
            /* 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';
            }

There is no way around this code without resetting temp_slash to zero
at the beginning of the loop...

...UNLESS the optimizer has optimized away all but the initial assignment 
to the 0 initial value, never again to reset it on the next iteration
through the do {} loop.

Does this make sense as the possible scenario?  Can you check this Dan?

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message