Michael Biebl, le jeu. 07 juin 2018 13:26:26 +0200, a ecrit:
> On Mon, 4 Jun 2018 00:50:26 +0200 Samuel Thibault <sthiba...@debian.org>
> wrote:
> > Package: rsyslog
> > Version: 8.34.0-1
> > Severity: important
> > Tags: patch
> > 
> > Hello,
> > 
> > rsyslog currently FTBFS on hurd-i386 due to unconditional uses of
> > PATH_MAX. Here is a patch fixing it.
> 
> If we are going to use PATH_MAX anyway as well for hurd, why not define
> it globally so avoid patching countless packages?

Because uncontrolled use of PATH_MAX leads to buffer overflows and whatnot.
(actually, very often, code using PATH_MAX do have buffer overflows,
while code using dynamic allocation don't).

We do not want to introduce such kind of limitation into realpath(), but
#defining PATH_MAX would mean we *have* to limit realpath(), otherwise
applications doing

char t[PATH_MAX];
realpath(some_ppath, t)

would overflow the buffer. Yes, realpath has a crappy interface
concerning PATH_MAX, blame POSIX for that.

Samuel

Reply via email to