about summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2021-12-17 18:35:44 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2021-12-17 18:49:27 +0530
commit2bbd07c715275eb6c616988925738a0517180d57 (patch)
tree74a7b45044d12f1f5b5b8aab16e1f9c6fad6bc23 /stdlib
parentb99b0f93ee8762fe53ff65802deb6f00700b9924 (diff)
downloadglibc-2bbd07c715275eb6c616988925738a0517180d57.tar.gz
glibc-2bbd07c715275eb6c616988925738a0517180d57.tar.xz
glibc-2bbd07c715275eb6c616988925738a0517180d57.zip
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 <siddhesh@sourceware.org>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/bits/stdlib.h2
1 files changed, 1 insertions, 1 deletions
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);