[PATCH] (coverity fix) s3:smbd: exit early if srv_send_smb fails

Jeremy Allison jra at samba.org
Wed Mar 15 17:09:31 UTC 2017


On Wed, Mar 15, 2017 at 11:43:01AM +0100, Aurélien Aptel via samba-technical wrote:
> Hi,
> 
> Here's a quick patch that checks srv_send_smb return code and exits
> early if it fails.
> 
> Please review and push.

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

Can I get a second Team reviewer ?


> From e22941286d1eaa5d68c3fb394800fe9667bed4eb Mon Sep 17 00:00:00 2001
> From: Aurelien Aptel <aaptel at suse.com>
> Date: Wed, 15 Mar 2017 11:34:20 +0100
> Subject: [PATCH] s3:smbd: exit early if srv_send_smb fails
> 
> coverity fix.
> 
> Signed-off-by: Aurelien Aptel <aaptel at suse.com>
> ---
>  source3/smbd/reply.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
> index 22941ec..0979e6e 100644
> --- a/source3/smbd/reply.c
> +++ b/source3/smbd/reply.c
> @@ -779,7 +779,9 @@ void reply_special(struct smbXsrv_connection *xconn, char *inbuf, size_t inbuf_s
>  	DEBUG(5,("init msg_type=0x%x msg_flags=0x%x\n",
>  		    msg_type, msg_flags));
>  
> -	srv_send_smb(xconn, outbuf, false, 0, false, NULL);
> +	if (!srv_send_smb(xconn, outbuf, false, 0, false, NULL)) {
> +		exit_server_cleanly("reply_special: srv_send_smb failed.");
> +	}
>  
>  	if (CVAL(outbuf, 0) != 0x82) {
>  		exit_server_cleanly("invalid netbios session");
> -- 
> 2.10.2
> 

> -- 
> Aurélien Aptel / SUSE Labs Samba Team
> GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
> SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
> GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)




More information about the samba-technical mailing list