1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

Don't zero out numwritten before using.... Found by Pierre Belanger belanger@pobox.com

Jeremy.
(This used to be commit 495e6e3287)
This commit is contained in:
Jeremy Allison 2002-09-30 05:24:12 +00:00
parent f9789eb987
commit f6bdffbf8d

View File

@ -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;