* debug/read_chk.c (__read_chk): Always fail if the buffer is too
authorUlrich Drepper <drepper@redhat.com>
Tue, 1 Mar 2005 01:20:39 +0000 (01:20 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 1 Mar 2005 01:20:39 +0000 (01:20 +0000)
small.
* debug/readlink_chk.c (__readlink_chk): Likewise.
* debug/pread64_chk.c (__pread64_chk): Likewise.
* debug/pread_chk.c (__pread_chk): Likewise.

ChangeLog
debug/read_chk.c
debug/readlink_chk.c

index 45915dc..ac79e43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,11 @@
 
        * posix/bits/unistd.h: Avoid calling __*_chk variants if we can
        determine the call will never trigger a failure.
+       * debug/read_chk.c (__read_chk): Always fail if the buffer is too
+       small.
+       * debug/readlink_chk.c (__readlink_chk): Likewise.
+       * debug/pread64_chk.c (__pread64_chk): Likewise.
+       * debug/pread_chk.c (__pread_chk): Likewise.
 
        * sysdeps/i386/i686/memset_chk.S: Remove alias and warning.
        * sysdeps/x86_64/memset_chk.S: Likewise.
index f738c48..da2bc94 100644 (file)
@@ -31,8 +31,8 @@ __read_chk (int fd, void *buf, size_t nbytes, size_t buflen)
     __chk_fail ();
 
 #ifdef HAVE_INLINED_SYSCALLS
-  return INLINE_SYSCALL (read, 3, fd, buf, nbytes);
+  return INLINE_SYSCALL (read, 3, fd, buf, nbytes);
 #else
-  return __read (fd, buf, nbytes);
+  return __read (fd, buf, nbytes);
 #endif
 }
index d8d61dc..ac18ee2 100644 (file)
@@ -31,8 +31,8 @@ __readlink_chk (const char *path, void *buf, size_t len, size_t buflen)
     __chk_fail ();
 
 #ifdef HAVE_INLINED_SYSCALLS
-  return INLINE_SYSCALL (readlink, 3, path, buf, MIN (len, buflen + 1));
+  return INLINE_SYSCALL (readlink, 3, path, buf, len);
 #else
-  return __readlink (path, buf, MIN (len, buflen + 1));
+  return __readlink (path, buf, len);
 #endif
 }