httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: svn commit: r1384924 - in /httpd/httpd/trunk: include/httpd.h server/request.c
Date Tue, 22 Apr 2014 09:03:43 GMT
On Tue, Apr 22, 2014 at 9:47 AM, Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
> The first part of the comment, against 'ap_os_escape_path', is, IMO, wrong.
> We are not guaranteed that, if partial is *not* set, that there will be one
> byte of additional space after the NUL.
>
> If partial *is* set, then we skip the :
>     *d++ = '.';
>     *d++ = '/';
> and extra bytes will be available after the NUL.
>
> But if it is *not* set, I think that there may be (unlikely) cases where not
> space is available at the end.
>
> So, either the comment should be updated or 1 extra byte should be
> allocated, to be safe. In this later case, the comment should also be
> updated to state that in *all* cases, one extra byte is available.
> +1 for allocating an extra byte.

+1 for extra byte too, appending '/' without (re)allocating is quite useful.

>
>
> Moreover, 'ap_os_escape_path' could be tweaked as in r1485723.

-0, it's a compromise between speed and space, filenames (paths) are
often shorter than logs (and maybe less subject to escaping), I'm not
sure it's worth the second loop in this case.

Regards,
Yann.

Mime
View raw message