s3:rpc_server: Check pointer before dereference
authorSamuel Cabrero <scabrero@suse.de>
Thu, 14 Feb 2019 13:22:49 +0000 (14:22 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 22 Jul 2019 16:49:15 +0000 (16:49 +0000)
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 <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_server/rpc_handles.c

index 36d313f08f4e6001e9a5fc80a8904d3753f63ad1..453dab6905f6c535f329d52a24d7986775b71b02 100644 (file)
@@ -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");
        }
 }