Netdev List
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Matthias Rosenfelder <mrosenfelder.lkml@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, davejwatson@fb.com,
	Julia Lawall <Julia.Lawall@lip6.fr>
Subject: Re: [RFC] tls: length check correct in do_tls_getsockopt_tx()?
Date: Wed, 5 Jul 2017 13:17:48 +0300	[thread overview]
Message-ID: <20170705101748.abfquxq73ey6lhme@mwanda> (raw)
In-Reply-To: <a0dac911-6401-12cb-611c-5a1723d943c1@gmail.com>

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?

regards,
dan carpenter

  reply	other threads:[~2017-07-05 10:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05  7:10 [RFC] tls: length check correct in do_tls_getsockopt_tx()? Matthias Rosenfelder
2017-07-05 10:17 ` Dan Carpenter [this message]
2017-07-05 11:07   ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170705101748.abfquxq73ey6lhme@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=mrosenfelder.lkml@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox