[Pkg-fonts-devel] Bug#877795: Bug#877795: fontforge: FTBFS on hurd-i386: PATH_MAX undeclared

Adam Borowski kilobyte at angband.pl
Thu Oct 5 22:48:44 UTC 2017

On Thu, Oct 05, 2017 at 03:02:05PM -0400, Aaron M. Ucko wrote:
> Source: fontforge
> Version: 1:20170731~dfsg-1
> Severity: important
> Tags: upstream
> Builds of recent fontforge versions for hurd-i386 (admittedly not a
> release architecture) have been failing:
>   /<<PKGBUILDDIR>>/./gutils/fsys.c:770:22: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'INT8_MAX'?
> The Hurd has no hard PATH_MAX; best practice is to check the relevant
> file system's _PC_PATH_MAX via pathconf, which can entail allocating
> buffers dynamically.

That "best practice" is a myth; _PC_PATH_MAX merely returns this same
hardcoded value via a roundabout way.  And allocating a buffer of only that
size means you'll have a buffer overflow or truncation, as paths can be much
longer than PATH_MAX.  This is why Hurd folks insist on not adding this
#define -- every use of it is a bug.

On the other hand, I can think of no valid use case for editing a font in a
path 4096 bytes deep.  Thus, artificially limitting path length in FontForge
sounds reasonable to me.

⢀⣴⠾⠻⢶⣦⠀ We domesticated dogs 36000 years ago; together we chased
⣾⠁⢰⠒⠀⣿⡁ animals, hung out and licked or scratched our private parts.
⢿⡄⠘⠷⠚⠋⠀ Cats domesticated us 9500 years ago, and immediately we got
⠈⠳⣄⠀⠀⠀⠀ agriculture, towns then cities.     -- whitroth on /.

More information about the Pkg-fonts-devel mailing list