summaryrefslogtreecommitdiff
path: root/source3/rpc_client/rpc_transport_np.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-02-19 14:24:17 -0800
committerJeremy Allison <jra@samba.org>2010-02-19 14:26:22 -0800
commit0055e33dbed0e81548464d01bcf864255bab3159 (patch)
tree8c5dda02a203b2518a87e022a26931ec187cb2ba /source3/rpc_client/rpc_transport_np.c
parentad77ae1d5870e06f8587ecf634e0b6bdcbb950d7 (diff)
downloadsamba-0055e33dbed0e81548464d01bcf864255bab3159.tar.gz
samba-0055e33dbed0e81548464d01bcf864255bab3159.tar.bz2
samba-0055e33dbed0e81548464d01bcf864255bab3159.zip
Second part of fix for bug #7159 - client rpc_transport doesn't cope with bad server data returns.
If server returns zero on a NP read. Report pipe broken. Prevents client from looping if it thinks there should be more data. Jeremy.
Diffstat (limited to 'source3/rpc_client/rpc_transport_np.c')
-rw-r--r--source3/rpc_client/rpc_transport_np.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c
index 501aa50b03..623a8b37cf 100644
--- a/source3/rpc_client/rpc_transport_np.c
+++ b/source3/rpc_client/rpc_transport_np.c
@@ -180,6 +180,12 @@ static void rpc_np_read_done(struct tevent_req *subreq)
return;
}
+ if (state->received == 0) {
+ TALLOC_FREE(subreq);
+ tevent_req_nterror(req, NT_STATUS_PIPE_BROKEN);
+ return;
+ }
+
memcpy(state->data, rcvbuf, state->received);
TALLOC_FREE(subreq);
tevent_req_done(req);