From 6cdd5eb36281d5f2f473b80e2aadf4e453d16d29 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Feb 2010 14:24:17 -0800 Subject: [PATCH 2/2] 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. (cherry picked from commit 0055e33dbed0e81548464d01bcf864255bab3159) --- source3/rpc_client/rpc_transport_np.c | 6 ++++++ 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 30c6f1f..1b9c7fc 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); -- 1.6.6.2