diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-03-19 21:04:10 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-03-19 21:04:10 +0000 |
commit | 8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf (patch) | |
tree | b7091affa76bbaf47e78a59dfc72b2102554eaf9 /debug | |
parent | f5c3480e830e94e0e51a0bdb1053944daed8bc58 (diff) | |
download | glibc-8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf.tar glibc-8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf.tar.gz glibc-8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf.tar.bz2 glibc-8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf.zip |
Updated to fedora-glibc-20050319T1907cvs/fedora-glibc-2_3_4-15
Diffstat (limited to 'debug')
-rw-r--r-- | debug/pread64_chk.c | 2 | ||||
-rw-r--r-- | debug/pread_chk.c | 2 | ||||
-rw-r--r-- | debug/recv_chk.c | 9 | ||||
-rw-r--r-- | debug/recvfrom_chk.c | 10 | ||||
-rw-r--r-- | debug/tst-chk1.c | 2 |
5 files changed, 9 insertions, 16 deletions
diff --git a/debug/pread64_chk.c b/debug/pread64_chk.c index d281ad54af..c0e0efdf85 100644 --- a/debug/pread64_chk.c +++ b/debug/pread64_chk.c @@ -26,6 +26,6 @@ __pread64_chk (int fd, void *buf, size_t nbytes, off64_t offset, size_t buflen) if (nbytes > buflen) __chk_fail (); - return __pread64 (fd, buf, offset, nbytes); + return __pread64 (fd, buf, nbytes, offset); } #endif diff --git a/debug/pread_chk.c b/debug/pread_chk.c index cf4f9f203c..702fddaaa3 100644 --- a/debug/pread_chk.c +++ b/debug/pread_chk.c @@ -26,6 +26,6 @@ __pread_chk (int fd, void *buf, size_t nbytes, off_t offset, size_t buflen) if (nbytes > buflen) __chk_fail (); - return __pread (fd, buf, offset, nbytes); + return __pread (fd, buf, nbytes, offset); } #endif 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 diff --git a/debug/recvfrom_chk.c b/debug/recvfrom_chk.c index 9403479c00..6fefcbd767 100644 --- a/debug/recvfrom_chk.c +++ b/debug/recvfrom_chk.c @@ -24,13 +24,9 @@ ssize_t __recvfrom_chk (int fd, void *buf, size_t n, size_t buflen, int flags, __SOCKADDR_ARG addr, socklen_t *addr_len) { - /* 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 = __recvfrom (fd, buf, MIN (n, buflen + 1), flags, - addr, addr_len); - if (nrecv > 0 && (size_t) nrecv > buflen) + if (n > buflen) __chk_fail (); - return nrecv; + + return __recvfrom (fd, buf, n, flags, addr, addr_len); } #endif diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c index dca41ab6dc..a9a7761f9e 100644 --- a/debug/tst-chk1.c +++ b/debug/tst-chk1.c @@ -771,7 +771,7 @@ do_test (void) || strcmp (getcwdbuf + 1, fname) != 0) FAIL (); -#if __USE_FORTIFY_LEVEL >= 1 +#if 0 && __USE_FORTIFY_LEVEL >= 1 CHK_FAIL_START if (getwd (getcwdbuf + 2) != getcwdbuf + 2) FAIL (); |