From: Samuel Cabrero Date: Thu, 14 Feb 2019 13:22:49 +0000 (+0100) Subject: s3:rpc_server: Check pointer before dereference X-Git-Tag: talloc-2.3.0~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d42b7cde208982f2344e0519ebbf6de5da2ec32;p=thirdparty%2Fsamba.git s3:rpc_server: Check pointer before dereference The debug message dereference the pointer, but as close_policy_by_pipe is called from pipes_struct destructor it may be not initialized yet if an error occur in the initialization code. Signed-off-by: Samuel Cabrero Reviewed-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c index 36d313f08f4..453dab6905f 100644 --- a/source3/rpc_server/rpc_handles.c +++ b/source3/rpc_server/rpc_handles.c @@ -413,9 +413,11 @@ void close_policy_by_pipe(struct pipes_struct *p) */ TALLOC_FREE(p->pipe_handles); - DEBUG(10,("Deleted handle list for RPC connection %s\n", - ndr_interface_name(&p->contexts->syntax.uuid, - p->contexts->syntax.if_version))); + DBG_DEBUG("Deleted handle list for RPC connection %s\n", + p->contexts ? + ndr_interface_name(&p->contexts->syntax.uuid, + p->contexts->syntax.if_version) : + "Unknown"); } }