net: Don't crash if lsa_LookupPrivDisplayName returns NULL
authorVolker Lendecke <vl@samba.org>
Wed, 22 Mar 2017 14:41:47 +0000 (15:41 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 23 Mar 2017 06:43:57 +0000 (07:43 +0100)
lsa_LookupPrivDisplayName on Windows 2012R2 can return success and still return
a NULL name:

rpc_api_pipe: got frag len of 36 at offset 0: NT_STATUS_OK
rpc_api_pipe: host 172.18.103.80 returned 12 bytes.
     lsa_LookupPrivDisplayName: struct lsa_LookupPrivDisplayName
        out: struct lsa_LookupPrivDisplayName
            disp_name                : *
                disp_name                : NULL
            returned_language_id     : *
                returned_language_id     : 0x0000 (0)
            result                   : NT_STATUS_OK

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 23 07:43:57 CET 2017 on sn-devel-144

source3/utils/net_rpc_rights.c

index 9640db0fe60bff85d8ec175bc472c25de2c95aa6..c37b04ebb9a1c91c641fe7259290a8e713ae9c6b 100644 (file)
@@ -153,7 +153,7 @@ static NTSTATUS enum_privileges(struct rpc_pipe_client *pipe_hnd,
                        continue;
                }
 
-               d_printf("%s\n", description->string);
+               d_printf("%s\n", description ? description->string : "??????");
        }
 
        return NT_STATUS_OK;