summaryrefslogtreecommitdiff
path: root/debug/recv_chk.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-03-19 21:04:10 +0000
committerJakub Jelinek <jakub@redhat.com>2005-03-19 21:04:10 +0000
commit8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf (patch)
treeb7091affa76bbaf47e78a59dfc72b2102554eaf9 /debug/recv_chk.c
parentf5c3480e830e94e0e51a0bdb1053944daed8bc58 (diff)
Updated to fedora-glibc-20050319T1907cvs/fedora-glibc-2_3_4-15
Diffstat (limited to 'debug/recv_chk.c')
-rw-r--r--debug/recv_chk.c9
1 files changed, 3 insertions, 6 deletions
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