s3:libsmb: return INTERNAL_ERROR if the request is in bad state when the caller ships it
authorStefan Metzmacher <metze@samba.org>
Sat, 17 Sep 2011 19:09:30 +0000 (21:09 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 18 Sep 2011 03:33:10 +0000 (05:33 +0200)
metze

source3/libsmb/async_smb.c

index 8336ec255aedc614ba632dbf283c565c5e62aa22..efeb328dd93103f2d470396afdf70389ca71d29c 100644 (file)
@@ -539,6 +539,10 @@ NTSTATUS cli_smb_req_send(struct tevent_req *req)
        struct cli_smb_state *state = tevent_req_data(
                req, struct cli_smb_state);
 
+       if (!tevent_req_is_in_progress(req)) {
+               return NT_STATUS_INTERNAL_ERROR;
+       }
+
        return cli_smb_req_iov_send(req, state, state->iov, state->iov_count);
 }
 
@@ -993,6 +997,10 @@ NTSTATUS cli_smb_chain_send(struct tevent_req **reqs, int num_reqs)
 
        iovlen = 0;
        for (i=0; i<num_reqs; i++) {
+               if (!tevent_req_is_in_progress(reqs[i])) {
+                       return NT_STATUS_INTERNAL_ERROR;
+               }
+
                state = tevent_req_data(reqs[i], struct cli_smb_state);
                iovlen += state->iov_count;
        }