summaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorsin2015-02-28 15:59:27 +0000
committersin2015-02-28 15:59:52 +0000
commit4672406edd54ffe1466cdcb4b36c849e7245d603 (patch)
tree290185a684d41da3f231f8f187ab5f55b2e481cc /include/stdlib.h
parent5ebf0ca70e32dd6091d540a3e0d6ef96af816070 (diff)
__fortify_realpath() should trap if PATH_MAX is not defined
This is currently done only if the pointer is non-NULL.
Diffstat (limited to '')
-rw-r--r--include/stdlib.h4
1 files changed, 4 insertions, 0 deletions
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)
19 size_t bos; 19 size_t bos;
20 20
21 if (resolved) { 21 if (resolved) {
22#ifndef PATH_MAX
23 __builtin_trap();
24#else
22 bos = __builtin_object_size(resolved, 0); 25 bos = __builtin_object_size(resolved, 0);
23 if (PATH_MAX > bos) 26 if (PATH_MAX > bos)
24 __builtin_trap(); 27 __builtin_trap();
28#endif
25 } 29 }
26 return realpath(path, resolved); 30 return realpath(path, resolved);
27} 31}