[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnu: patch: Set PATH_MAX for HURD systems.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] gnu: patch: Set PATH_MAX for HURD systems. |
Date: |
Thu, 11 Jun 2015 17:04:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Manolis Ragkousis <address@hidden> skribis:
> Hey Ludo,
>
> On 10 June 2015 at 22:38, Ludovic Courtès <address@hidden> 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’.