lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150331203851.26627614@synchrony.poochiereds.net>
Date:	Tue, 31 Mar 2015 20:38:51 -0400
From:	Jeff Layton <jlayton@...chiereds.net>
To:	Steve French <smfrench@...il.com>
Cc:	linux-cifs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] [SMB3] Fix coverity warning

On Fri, 27 Mar 2015 00:28:02 -0500
Steve French <smfrench@...il.com> wrote:

> Coverity reports a warning for referencing the beginning of the
> SMB2/SMB3 frame using the ProtocolId field as an array. Although
> it works the same either way, this patch should quiet the warning
> and might be a little clearer.
> 
> Reported by Coverity (CID 741269)
> 
> Signed-off-by: Steve French <smfrench@...il.com>
> ---
>  fs/cifs/smb2misc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
> index 689f035..22dfdf1 100644
> --- a/fs/cifs/smb2misc.c
> +++ b/fs/cifs/smb2misc.c
> @@ -322,7 +322,7 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr)
>  
>  	/* return pointer to beginning of data area, ie offset from SMB start */
>  	if ((*off != 0) && (*len != 0))
> -		return hdr->ProtocolId + *off;
> +		return (char *)(&hdr->ProtocolId[0]) + *off;
>  	else
>  		return NULL;
>  }

Acked-by: Jeff Layton <jlayton@...chiereds.net>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ