summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/clireadwrite.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 14b6401051..64bdb484f3 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -903,7 +903,9 @@ NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten)
if (tevent_req_is_nterror(req, &status)) {
return status;
}
- *pwritten = state->written;
+ if (pwritten != 0) {
+ *pwritten = state->written;
+ }
return NT_STATUS_OK;
}