From 0055e33dbed0e81548464d01bcf864255bab3159 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Feb 2010 14:24:17 -0800 Subject: 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. --- source3/rpc_client/rpc_transport_np.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/rpc_client/rpc_transport_np.c') 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); -- cgit