r10705: fixed a crash bug in the getdcname irpc server for winbind. The
authorAndrew Tridgell <tridge@samba.org>
Tue, 4 Oct 2005 01:43:24 +0000 (01:43 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:22 +0000 (13:39 -0500)
problem was that the return string was declared as:

[out] astring dcname

which means "this is a non-NULL string". The server code sometimes
returned NULL however (on getdc lookup failure), which caused the NDR
marshalling code to crash. When you declare a non-pointer return value
you are promising that the value can never be NULL.

The trivial fix is to use:

[out] astring *dcname

which leaves the API alone, but includes a pointer in the wire format,
which in turn means it is valid to send a NULL string as a response.
(This used to be commit e39bac61960f6ce8957f148a482e39499a8e9096)

source4/librpc/idl/irpc.idl

index 1c4b8d2c53a8405ef71a46d5b1bdde42ff52e2b4..34998d57a750e626247e6385078aec49301a4b87 100644 (file)
@@ -59,7 +59,7 @@
                [in] astring my_accountname,
                [in] uint32 account_control,
                [in,ref] dom_sid *domain_sid,
-               [out] astring dcname
+               [out] astring *dcname
                );
 
        /******************************************************