pkgconf/libpkgconf
Fabian Groffen 13a5d9a5f0 libpkgconf: path: supply buffer to realpath
To avoid a crash on some platforms (like Darwin 9) provide a buffer to
realpath(3).

Darwin 9 (last PPC target) documents realpath needs to be given a buffer
to the resolved_path argument large enough to hold PATH_MAX bytes.
With NULL argument it crashes.  Solaris makes no mention of
resolved_path to be allowed NULL, yet recent versions accept it and
malloc(3) accordingly.

Because the documentation explicitly mentions PATH_MAX being the limit
to what realpath(3) would write in resolved_path, switching to a static
buffer here doesn't limit resolution compared to dynamically allocating
a buffer by realpath(3).

While this change requires a bit more space on the stack, it avoids a
malloc/free sequence, and allows successful operation on (older)
platforms that lack support for dynamically allocating a return buffer
in realpath(3).

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2021-01-08 18:44:40 -05:00
..
argvsplit.c fix missing backslashes in paths on Windows 2020-05-30 12:39:43 -06:00
audit.c libpkgconf: document audit module 2016-12-10 19:28:34 -06:00
bsdstubs.c Minimal tweaks to compile with Visual C 2015 2017-06-04 19:19:55 -07:00
bsdstubs.h normalize include guards. closes #33 2019-05-25 16:00:09 -05:00
cache.c libpkgconf: cache: fix refcount issue exposed by recent depgraph solver changes 2017-12-08 13:39:40 -06:00
client.c fix the order of header includes 2019-06-08 04:55:52 +03:00
config.h.meson meson: remove some autotools cruft 2020-06-02 18:58:00 -06:00
dependency.c libpkgconf: dependency: fix out of boundary write 2020-05-26 14:03:55 -06:00
fileio.c libpkgconf: fileio: prevent buffer overflow. 2020-05-24 14:09:44 -06:00
fragment.c libpkgconf: fragment: fix out of boundary write 2020-05-30 19:05:53 -06:00
iter.h normalize include guards. closes #33 2019-05-25 16:00:09 -05:00
libpkgconf-api.h normalize include guards. closes #33 2019-05-25 16:00:09 -05:00
libpkgconf.h pkgconf 1.7.0. 2020-05-24 14:55:02 -06:00
meson.build meson: install headers into pkgconf/libpkgconf instead of just libpkgconf 2020-11-28 19:42:00 -07:00
parser.c libpkgconf: parser: fix out of boundary access 2020-05-24 14:10:18 -06:00
path.c libpkgconf: path: supply buffer to realpath 2021-01-08 18:44:40 -05:00
personality.c libpkgconf: personality: fix out of boundary access 2020-05-25 05:55:39 -06:00
pkg.c pkgconf_pkg_parser_version_func: fix whitespace detection 2020-11-28 19:17:03 -07:00
queue.c libpkgconf: dependency: allow dependency nodes to be colored with traits 2018-03-18 18:03:33 -05:00
stdinc.h normalize include guards. closes #33 2019-05-25 16:00:09 -05:00
tuple.c libpkgconf: tuple: fix truncation when no overflow occurs 2020-05-30 19:20:25 -06:00
win-dirent.h normalize include guards. closes #33 2019-05-25 16:00:09 -05:00