From: Volker Lendecke Date: Mon, 18 Jan 2021 20:28:30 +0000 (+0100) Subject: tstream_npa: Allow NULL output parameters X-Git-Tag: tevent-0.11.0~1322 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b47dd65a3815e38537af335792353fca6c40f03;p=thirdparty%2Fsamba.git tstream_npa: Allow NULL output parameters When reading the info4, the substructs might not be interesting for you. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/libcli/named_pipe_auth/npa_tstream.c b/libcli/named_pipe_auth/npa_tstream.c index 7ebafaa7ddc..fcd616819c3 100644 --- a/libcli/named_pipe_auth/npa_tstream.c +++ b/libcli/named_pipe_auth/npa_tstream.c @@ -1348,13 +1348,25 @@ int _tstream_npa_accept_existing_recv( *info4 = dst; } - *remote_client_addr = talloc_move(mem_ctx, &state->remote_client_addr); - *_remote_client_name = discard_const_p( - char, talloc_move(mem_ctx, &i4->remote_client_name)); - *local_server_addr = talloc_move(mem_ctx, &state->local_server_addr); - *local_server_name = discard_const_p( - char, talloc_move(mem_ctx, &i4->local_server_name)); - *session_info = talloc_move(mem_ctx, &i4->session_info); + if (remote_client_addr != NULL) { + *remote_client_addr = talloc_move( + mem_ctx, &state->remote_client_addr); + } + if (_remote_client_name != NULL) { + *_remote_client_name = discard_const_p( + char, talloc_move(mem_ctx, &i4->remote_client_name)); + } + if (local_server_addr != NULL) { + *local_server_addr = talloc_move( + mem_ctx, &state->local_server_addr); + } + if (local_server_name != NULL) { + *local_server_name = discard_const_p( + char, talloc_move(mem_ctx, &i4->local_server_name)); + } + if (session_info != NULL) { + *session_info = talloc_move(mem_ctx, &i4->session_info); + } tevent_req_received(req); return 0;