about summary refs log tree commit diff
path: root/debug/getcwd_chk.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-03-01 00:42:41 +0000
committerUlrich Drepper <drepper@redhat.com>2005-03-01 00:42:41 +0000
commit8b8b797292218050ff191ccb90da498862afd0f2 (patch)
treeaf2f3e0fd794ea7430f73b688611dfab0d5d69d9 /debug/getcwd_chk.c
parent61062f56304750c367c5c1533351621353c112a7 (diff)
downloadglibc-8b8b797292218050ff191ccb90da498862afd0f2.tar.gz
glibc-8b8b797292218050ff191ccb90da498862afd0f2.tar.xz
glibc-8b8b797292218050ff191ccb90da498862afd0f2.zip
(__getcwd_chk): Always fail if the buffer is too small.
Diffstat (limited to 'debug/getcwd_chk.c')
-rw-r--r--debug/getcwd_chk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/debug/getcwd_chk.c b/debug/getcwd_chk.c
index 9e14a0102e..cb864c858e 100644
--- a/debug/getcwd_chk.c
+++ b/debug/getcwd_chk.c
@@ -24,8 +24,8 @@
 char *
 __getcwd_chk (char *buf, size_t size, size_t buflen)
 {
-  char *res = __getcwd (buf, MIN (size, buflen));
-  if (res == NULL && errno == ERANGE && size > buflen)
+  if (size > buflen)
     __chk_fail ();
-  return res;
+
+  return __getcwd (buf, size);
 }