From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu: patch: Set PATH_MAX for HURD systems. Date: Thu, 11 Jun 2015 17:04:27 +0200 Message-ID: <87si9ywakk.fsf@gnu.org> References: <87mw07gxpq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z341y-0007wf-EN for Guix-devel@gnu.org; Thu, 11 Jun 2015 11:04:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z341u-0000dF-9w for Guix-devel@gnu.org; Thu, 11 Jun 2015 11:04:34 -0400 In-Reply-To: (Manolis Ragkousis's message of "Thu, 11 Jun 2015 12:35:26 +0300") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Manolis Ragkousis Cc: Guix-devel Manolis Ragkousis skribis: > Hey Ludo, > > On 10 June 2015 at 22:38, Ludovic Court=C3=A8s wrote: >> Please use the patch from >> , >> 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 =3D xmalloc (PATH_MAX); > + char *buffer =3D xmalloc (tost->st_size + 1); >=20=20 > - 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] =3D '\0'; once safe_readlink has succeeded. I wonder why that even works currently. Thanks, Ludo=E2=80=99.