diff options
author | Volker Lendecke <vl@samba.org> | 2021-01-18 21:28:30 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2021-04-01 19:32:36 +0000 |
commit | 1b47dd65a3815e38537af335792353fca6c40f03 (patch) | |
tree | 37bebde25484f07f2b3ed28929012bc8e1a9c311 /libcli | |
parent | bbfdf2708e8e85cee56aeff43c9216d2003ed310 (diff) | |
download | samba-1b47dd65a3815e38537af335792353fca6c40f03.tar.gz |
tstream_npa: Allow NULL output parameters
When reading the info4, the substructs might not be interesting for
you.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/named_pipe_auth/npa_tstream.c | 26 |
1 files changed, 19 insertions, 7 deletions
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; |