Re: canonicalize-lgpl: support paths of length > 2 GB

2016-10-20 Thread Bruno Haible
Padraig Brady: > The attached should address that. Thanks Pádraig. Looks fine. Bruno

Re: canonicalize-lgpl: support paths of length > 2 GB

2016-10-20 Thread Tom G. Christensen
On 20/10/16 20:32, Padraig Brady wrote: Unfortunately this broke the build on CentOS 3 and 4. Thanks for testing. The attached should address that. Yes, that fixed it for me. -tgc

Re: canonicalize-lgpl: support paths of length > 2 GB

2016-10-20 Thread Padraig Brady
> Unfortunately this broke the build on CentOS 3 and 4. Thanks for testing. The attached should address that. >From b5393eae6e267c2c833895dc840b6a85cc94561d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Thu, 20 Oct 2016 11:28:07 -0700 Subject: [PATCH]

Re: canonicalize-lgpl: support paths of length > 2 GB

2016-10-20 Thread Tom G. Christensen
On 15/10/16 14:52, Bruno Haible wrote: Pádraig Brady wrote: +1 OK. Pushed. Unfortunately this broke the build on CentOS 3 and 4. Here's the error from a CentOS 4 host: gcc -std=gnu99 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -DNO_XMALLOC -DEXEEXT=\"\" -I. -I..

Re: canonicalize-lgpl: support paths of length > 2 GB

2016-10-15 Thread Bruno Haible
Pádraig Brady wrote: > > +1 OK. Pushed. Bruno

Re: canonicalize-lgpl: support paths of length > 2 GB

2016-10-15 Thread Pádraig Brady
On 15/10/16 11:10, Bruno Haible wrote: > Hi Pádraig, > Thanks, also for the integer overflow check (useful also for the LP64 > platforms). Here is the proposed revised patch. > - if ((long int) (n + len) >= path_max) > + /* Check that n + len + 1 doesn't overflow and is

Re: canonicalize-lgpl: support paths of length > 2 GB

2016-10-15 Thread Bruno Haible
Hi Pádraig, > There is a later cast to (long int) that would > similarly truncate large values on LLP64 systems. > How about something like this as well? > > @@ -311,7 +312,7 @@ __realpath (const char *name, char *resolved) > } > >len = strlen (end); > -

Re: canonicalize-lgpl: support paths of length > 2 GB

2016-10-14 Thread Pádraig Brady
On 14/10/16 01:57, Bruno Haible wrote: > Hi, > > If pathconf (name, _PC_PATH_MAX) returns a PATH_MAX value > 2 GB, > the readlink call in canonicalize-lgpl.c line 292 may return a length > 2 GB, > therefore the implicit cast (assignment) to 'int' will produce a wrong value. > > If you agree with

canonicalize-lgpl: support paths of length > 2 GB

2016-10-13 Thread Bruno Haible
Hi, If pathconf (name, _PC_PATH_MAX) returns a PATH_MAX value > 2 GB, the readlink call in canonicalize-lgpl.c line 292 may return a length > 2 GB, therefore the implicit cast (assignment) to 'int' will produce a wrong value. If you agree with this patch, it'd be a good idea to propagate it into