libsmbclient: Initialize written in cli_splice_fallback()
authorBailey Berro <baileyberro@chromium.org>
Tue, 26 Jun 2018 20:13:39 +0000 (13:13 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 12 Jul 2018 11:10:26 +0000 (13:10 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13511

Signed-off-by: Bailey Berro <baileyberro@chromium.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Jul  9 21:29:48 CEST 2018 on sn-devel-144

(cherry picked from commit fe25bc793d30a64f06b19f737c652b0c7389ca92)

source3/libsmb/clireadwrite.c

index 39874779bc1cb8facb400080c800ede84ea442d7..00ee09ece89de74455a59af5c895a2cc5cb81a87 100644 (file)
@@ -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;
                }