From: Bailey Berro Date: Tue, 26 Jun 2018 20:13:39 +0000 (-0700) Subject: libsmbclient: Initialize written in cli_splice_fallback() X-Git-Tag: tevent-0.9.37~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe25bc793d30a64f06b19f737c652b0c7389ca92;p=thirdparty%2Fsamba.git libsmbclient: Initialize written in cli_splice_fallback() BUG: https://bugzilla.samba.org/show_bug.cgi?id=13511 Signed-off-by: Bailey Berro Reviewed-by: David Mulder Reviewed-by: Jeremy Allison Reviewed-by: David Disseldorp Autobuild-User(master): David Disseldorp Autobuild-Date(master): Mon Jul 9 21:29:48 CEST 2018 on sn-devel-144 --- diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c index 39874779bc1..00ee09ece89 100644 --- a/source3/libsmb/clireadwrite.c +++ b/source3/libsmb/clireadwrite.c @@ -1459,6 +1459,7 @@ static NTSTATUS cli_splice_fallback(TALLOC_CTX *frame, uint8_t *buf = talloc_size(frame, SPLICE_BLOCK_SIZE); size_t nread; off_t remaining = initial_size; + *written = 0; while (remaining) { status = cli_read(srccli, src_fnum, @@ -1480,6 +1481,7 @@ static NTSTATUS cli_splice_fallback(TALLOC_CTX *frame, } src_offset += nread; dst_offset += nread; + *written += nread; if (remaining < nread) { return NT_STATUS_INTERNAL_ERROR; }