[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: canonicalize-lgpl: support paths of length > 2 GB
From: |
Bruno Haible |
Subject: |
Re: canonicalize-lgpl: support paths of length > 2 GB |
Date: |
Sat, 15 Oct 2016 12:10:52 +0200 |
User-agent: |
KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; ) |
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);
> - if ((long int) (n + len) >= path_max)
> + if (SIZE_MAX - len <= n || path_max <= n + len)
> {
> freea (buf);
> __set_errno (ENAMETOOLONG);
Thanks, also for the integer overflow check (useful also for the LP64
platforms). Here is the proposed revised patch.
Bruno
0001-canonicalize-lgpl-Support-the-case-path_max-INT_MAX.patch
Description: Text Data