[PATCH] Avoid a crash in "net rpc rights list"

Jeremy Allison jra at samba.org
Thu Mar 23 02:47:41 UTC 2017


On Wed, Mar 22, 2017 at 03:45:04PM +0100, Volker Lendecke via samba-technical wrote:
> Hi!
> 
> Review appreciated!

Reviewed-by: Jeremy Allison <jra at samba.org>
Pushed !

> From 4a86a886b5248bdec6fb7e2d6d9a881d613c60ad Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Wed, 22 Mar 2017 15:41:47 +0100
> Subject: [PATCH] net: Don't crash if lsa_LookupPrivDisplayName returns NULL
> 
> 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 at samba.org>
> ---
>  source3/utils/net_rpc_rights.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c
> index 9640db0..c37b04e 100644
> --- a/source3/utils/net_rpc_rights.c
> +++ b/source3/utils/net_rpc_rights.c
> @@ -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;
> -- 
> 2.1.4
> 




More information about the samba-technical mailing list