diff options
author | Jeremy Allison <jra@samba.org> | 2002-09-30 05:19:43 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-09-30 05:19:43 +0000 |
commit | a7009ad5c8aaae350b2521b8c0cd2538e561618a (patch) | |
tree | f5851e943ec085f4de713fbf70d7ca2bc15b4ded /source | |
parent | d60afa48e3214a4fa4c0a937635c3acf2a4b4a65 (diff) | |
download | samba-a7009ad5c8aaae350b2521b8c0cd2538e561618a.tar.gz samba-a7009ad5c8aaae350b2521b8c0cd2538e561618a.tar.xz samba-a7009ad5c8aaae350b2521b8c0cd2538e561618a.zip |
Don't zero out numwritten before using.... Found by Pierre Belanger belanger@pobox.com
Jeremy.
Diffstat (limited to 'source')
-rw-r--r-- | source/lib/sendfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/lib/sendfile.c b/source/lib/sendfile.c index 98a52608b8d..5d1cf2f10bc 100644 --- a/source/lib/sendfile.c +++ b/source/lib/sendfile.c @@ -208,10 +208,10 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of hdtrl[0].iov_base = NULL; hdtrl[0].iov_len = 0; } else { - nwritten = 0; /* iov_base is defined as a void *... */ hdtrl[0].iov_base = ((char *)hdtrl[0].iov_base) + nwritten; hdtrl[0].iov_len -= nwritten; + nwritten = 0; } } total -= nwritten; @@ -280,9 +280,9 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of hdtrl.iov_base = NULL; hdtrl.iov_len = 0; } else { - nwritten = 0; hdtrl.iov_base += nwritten; hdtrl.iov_len -= nwritten; + nwritten = 0; } } total -= nwritten; |