[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1707051306320.3050@hadrien>
Date: Wed, 5 Jul 2017 13:07:40 +0200 (CEST)
From: Julia Lawall <julia.lawall@...6.fr>
To: Dan Carpenter <dan.carpenter@...cle.com>
cc: Matthias Rosenfelder <mrosenfelder.lkml@...il.com>,
netdev@...r.kernel.org, davem@...emloft.net, davejwatson@...com
Subject: Re: [RFC] tls: length check correct in do_tls_getsockopt_tx()?
On Wed, 5 Jul 2017, Dan Carpenter wrote:
> On Wed, Jul 05, 2017 at 03:10:53AM -0400, Matthias Rosenfelder wrote:
> > Hi,
> >
> > In do_tls_getsockopt_tx():
> >
> > if (len == sizeof(crypto_info)) {
> >
> > should be
> >
> > if (len == sizeof(*crypto_info)) {
> >
> > as crypto_info is of pointer type. Or am I missing something?
>
> No, you're right. It should be "sizeof(*crypto_info)".
>
> It's hard for Smatch to catch these sorts of bugs because Sparse
> sometimes just gives Smatch a number literal instead of a sizeof()
> expression. I think Coccinelle can catch these kinds of bugs?
Currently, I think the Coccinelle rules are only looking for things like x
= f(...,sizeof(x),...)
julia
Powered by blists - more mailing lists