From 4672406edd54ffe1466cdcb4b36c849e7245d603 Mon Sep 17 00:00:00 2001 From: sin Date: Sat, 28 Feb 2015 15:59:27 +0000 Subject: __fortify_realpath() should trap if PATH_MAX is not defined This is currently done only if the pointer is non-NULL. --- include/stdlib.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/stdlib.h') diff --git a/include/stdlib.h b/include/stdlib.h index 2948b54..f3a5ccd 100644 --- 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); } -- cgit v1.3