--- ./server/request.c 2007-07-25 10:13:49.000000000 -0300 +++ ./server/request.c 2008-06-11 22:22:53.000000000 -0300 @@ -963,6 +963,10 @@ "access to %s denied", r->uri); return r->status = HTTP_FORBIDDEN; } + else if (APR_STATUS_IS_ENAMETOOLONG(rv)) { + thisinfo.filetype = APR_NOFILE; + break; + } else if ((rv != APR_SUCCESS && rv != APR_INCOMPLETE) || !(thisinfo.valid & APR_FINFO_TYPE)) { /* If we hit ENOTDIR, we must have over-optimized, deny --- ./srclib/apr/file_io/unix/filestat.c 2007-10-17 00:36:49.000000000 -0300 +++ ./srclib/apr/file_io/unix/filestat.c 2008-06-11 22:26:50.000000000 -0300 @@ -279,6 +279,14 @@ struct_stat info; int srv; + /* Catch fname length == MAX_PATH since GetFileAttributesEx fails + * with PATH_NOT_FOUND. We would rather indicate length error than + * 'not found' + */ + if (strlen(fname) >= APR_PATH_MAX) { + return APR_ENAMETOOLONG; + } + if (wanted & APR_FINFO_LINK) srv = lstat(fname, &info); else