From 8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 19 Mar 2005 21:04:10 +0000 Subject: Updated to fedora-glibc-20050319T1907 --- debug/recv_chk.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'debug/recv_chk.c') diff --git a/debug/recv_chk.c b/debug/recv_chk.c index f83bd3ed2f..090e63c5b9 100644 --- a/debug/recv_chk.c +++ b/debug/recv_chk.c @@ -23,12 +23,9 @@ ssize_t __recv_chk (int fd, void *buf, size_t n, size_t buflen, int flags) { - /* In case N is greater than BUFLEN, we read BUFLEN+1 bytes. - This might overflow the buffer but the damage is reduced to just - one byte. And the program will terminate right away. */ - ssize_t nrecv = __recv (fd, buf, MIN (n, buflen + 1), flags); - if (nrecv > 0 && (size_t) nrecv > buflen) + if (n > buflen) __chk_fail (); - return nrecv; + + return __recv (fd, buf, n, flags); } #endif -- cgit v1.2.3