From 2bbd07c715275eb6c616988925738a0517180d57 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Fri, 17 Dec 2021 18:35:44 +0530 Subject: fortify: Fix spurious warning with realpath The length and object size arguments were swapped around for realpath. Also add a smoke test so that any changes in this area get caught in future. Signed-off-by: Siddhesh Poyarekar Reviewed-by: Adhemerval Zanella --- stdlib/bits/stdlib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stdlib/bits/stdlib.h') diff --git a/stdlib/bits/stdlib.h b/stdlib/bits/stdlib.h index 067115eeca..ccacbdf76a 100644 --- a/stdlib/bits/stdlib.h +++ b/stdlib/bits/stdlib.h @@ -42,7 +42,7 @@ __NTH (realpath (const char *__restrict __name, char *__restrict __resolved)) return __realpath_alias (__name, __resolved); #if defined _LIBC_LIMITS_H_ && defined PATH_MAX - if (__glibc_unsafe_len (sz, sizeof (char), PATH_MAX)) + if (__glibc_unsafe_len (PATH_MAX, sizeof (char), sz)) return __realpath_chk_warn (__name, __resolved, sz); #endif return __realpath_chk (__name, __resolved, sz); -- cgit v1.2.3-70-g09d2