On Mon, Jan 17, 2022 at 5:10 PM <minf...@apache.org> wrote:
>
> Modified: httpd/httpd/trunk/modules/dav/main/mod_dav.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/main/mod_dav.c?rev=1897156&r1=1897155&r2=1897156&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/dav/main/mod_dav.c (original)
> +++ httpd/httpd/trunk/modules/dav/main/mod_dav.c Mon Jan 17 16:10:51 2022
> @@ -723,6 +737,57 @@ static int dav_get_overwrite(request_rec
>      return -1;
>  }
>
> +static int uripath_is_canonical(const char *uripath)

Maybe reuse ap_normalize_path() for the implementation, like:

static int uripath_is_canonical(apr_pool_t *p, const char *uripath)
{
    char *path = apr_pstrdup(uripath);
    return (ap_normalize_path(path, (AP_NORMALIZE_MERGE_SLASHES |
                                     AP_NORMALIZE_NOT_ABOVE_ROOT))
            && strcmp(uri_path, path) == 0);
}

?


Regards;
Yann.

Reply via email to