summaryrefslogtreecommitdiff
path: root/include/sys
diff options
context:
space:
mode:
authorNatanael Copa2015-05-07 14:50:03 +0200
committersin2015-05-07 15:02:11 +0100
commitc2bb9e106a32619726cfc5052a1509e96b90de9f (patch)
treed6dfbd159f911fcfe2cd9f0f41f6d40c107fb792 /include/sys
parentc7e82d4863992c2f3bbb6f5a31fa8e5fd0e1643f (diff)
fix realpath when stdlib.h is included before limits.h
If program includes stdlib.h before limits.h without _XOPEN_SOURCE, _GNU_SOURCE or _BSD_SOURCE explicitly set, then will it always trigger the trap with musl libc. This is becase stdlib.h will pull in features.h which will set _GNU_SOURCE. This means that the fortify stdlib.h will not include limits.h but it will still trigger the fortified realpath(), but without PATH_MAX set. We fix this by including system stdlib.h before testing if limits.h should be included. Since PATH_MAX is known at compile time we can also error at compile time, instead of compiling a broken realpath().
Diffstat (limited to 'include/sys')
0 files changed, 0 insertions, 0 deletions