fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

commit 4672406edd54ffe1466cdcb4b36c849e7245d603
parent 5ebf0ca70e32dd6091d540a3e0d6ef96af816070
Author: sin <sin@2f30.org>
Date:   Sat, 28 Feb 2015 15:59:27 +0000

__fortify_realpath() should trap if PATH_MAX is not defined

This is currently done only if the pointer is non-NULL.

Diffstat:
Minclude/stdlib.h | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/stdlib.h b/include/stdlib.h @@ -19,9 +19,13 @@ __fortify_realpath(const char *path, char *resolved) size_t bos; if (resolved) { +#ifndef PATH_MAX + __builtin_trap(); +#else bos = __builtin_object_size(resolved, 0); if (PATH_MAX > bos) __builtin_trap(); +#endif } return realpath(path, resolved); }