s3:smb2cli: fix the num_expected == 0 logic in smb2cli_req_recv()
authorStefan Metzmacher <metze@samba.org>
Fri, 23 Sep 2011 20:47:33 +0000 (22:47 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 29 Sep 2011 20:15:06 +0000 (22:15 +0200)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Sep 29 22:15:06 CEST 2011 on sn-devel-104

source3/libsmb/smb2cli_base.c

index f8b2f6e5df54e2e30ce21b87236929f66d70e8e2..b85158f8c74c79e81ebbbb94d319d324fdf48393 100644 (file)
@@ -690,9 +690,8 @@ NTSTATUS smb2cli_req_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
        bool found_size = false;
        size_t i;
 
-       if (num_expected == 0) {
-               found_status = true;
-               found_size = true;
+       if (piov != NULL) {
+               *piov = NULL;
        }
 
        if (tevent_req_is_nterror(req, &status)) {
@@ -710,6 +709,11 @@ NTSTATUS smb2cli_req_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                return status;
        }
 
+       if (num_expected == 0) {
+               found_status = true;
+               found_size = true;
+       }
+
        status = NT_STATUS(IVAL(state->recv_iov[0].iov_base, SMB2_HDR_STATUS));
        body_size = SVAL(state->recv_iov[1].iov_base, 0);