public inbox for ccan@ozlabs.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: ccan@lists.ozlabs.org, rusty@rustcorp/com.au
Subject: Re: [PATCH 4/7] crypto/hmac_sha256: Remove undefined memset()
Date: Wed, 12 Apr 2017 16:56:13 -0700	[thread overview]
Message-ID: <87wpap5gf6.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20170405122321.GA15755@umbus.fritz.box>

David Gibson <david@gibson.dropbear.id.au> writes:
> [ Unknown signature status ]
> On Tue, Apr 04, 2017 at 11:52:39AM +0930, Paul 'Rusty' Russell wrote:
>> David Gibson <david@gibson.dropbear.id.au> writes:
>> > A memset() with a zero length argument isn't well defined.  It *might* be
>> > a no-op, but then it might not.  So, test for this case in
>> > hmac_sha256_init().
>> 
>> Huh?  That seems really odd.
>
> Well.. more precisely, my understanding is that memset(p, x, 0) can't
> be counted on not to dereference p.

That seems nonsensical, though.

> In this case, k_ipad + ksize is past the end of the array, and so not
> a valid pointer to dereference.

The pointer is valid (C's famous one-past-end exception), dereferencing
it is not.

What's the actual coverity error?

Thanks,
Rusty.
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

  reply	other threads:[~2017-04-18  3:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 11:11 [PATCH 0/7] Coverity David Gibson
2017-04-03 11:11 ` [PATCH 1/7] .travis.yml: Add support for Coverity Scan David Gibson
2017-04-03 12:14   ` David Gibson
2017-04-03 11:11 ` [PATCH 2/7] failtest: Remove memory leak David Gibson
2017-04-03 11:11 ` [PATCH 3/7] tools: Remove fd leak David Gibson
2017-04-03 11:11 ` [PATCH 4/7] crypto/hmac_sha256: Remove undefined memset() David Gibson
2017-04-04  2:22   ` Rusty Russell
2017-04-05 12:23     ` David Gibson
2017-04-12 23:56       ` Rusty Russell [this message]
2017-04-18  4:22         ` Timothy B. Terriberry
2017-04-24  2:30           ` Rusty Russell
2017-04-03 11:11 ` [PATCH 5/7] crypto/ripemd160: Correct badly sized union member David Gibson
2017-04-03 11:11 ` [PATCH 6/7] ccanlint: Fix leak in do_reduce_features() David Gibson
2017-04-03 11:11 ` [PATCH 7/7] net: Add check for failure of setsockopt() David Gibson
2017-04-04  2:23   ` Rusty Russell

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=87wpap5gf6.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=ccan@lists.ozlabs.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=rusty@rustcorp/com.au \
    /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