diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-03-01 00:42:41 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-03-01 00:42:41 +0000 |
commit | 8b8b797292218050ff191ccb90da498862afd0f2 (patch) | |
tree | af2f3e0fd794ea7430f73b688611dfab0d5d69d9 /debug/getcwd_chk.c | |
parent | 61062f56304750c367c5c1533351621353c112a7 (diff) | |
download | glibc-8b8b797292218050ff191ccb90da498862afd0f2.zip glibc-8b8b797292218050ff191ccb90da498862afd0f2.tar.gz glibc-8b8b797292218050ff191ccb90da498862afd0f2.tar.bz2 |
(__getcwd_chk): Always fail if the buffer is too small.
Diffstat (limited to 'debug/getcwd_chk.c')
-rw-r--r-- | debug/getcwd_chk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/debug/getcwd_chk.c b/debug/getcwd_chk.c index 9e14a01..cb864c8 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); } |