Manolis Ragkousis <manolis...@gmail.com> skribis:

> Hey Ludo,
>
> On 10 June 2015 at 22:38, Ludovic Courtès <l...@gnu.org> wrote:
>> Please use the patch from
>> <http://lists.gnu.org/archive/html/bug-patch/2015-06/msg00009.html>,
>> and be sure to mention that URL in the .patch file.
>
> Ok, but this patch is not enough. There is another occurrence of
> PATH_MAX later in the same file.
>
> The attached patch is an update of your patch.
>
> Ok to use this version?

[...]

>    if (S_ISLNK (mode))
>      {
> -      char *buffer = xmalloc (PATH_MAX);
> +      char *buffer = xmalloc (tost->st_size + 1);
>  
> -      if (safe_readlink (from, buffer, PATH_MAX) < 0)
> +      if (safe_readlink (from, buffer, tost->st_size) < 0)

LGTM; do send it to bug-patch as well.

Besides, I think this code misses:

  buffer[tost->st_size] = '\0';

once safe_readlink has succeeded.  I wonder why that even works
currently.

Thanks,
Ludo’.

Reply via email to