All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ] unit/test-ecc: Fix uninitialised values
Date: Fri, 9 Feb 2018 15:41:07 +0100	[thread overview]
Message-ID: <2425F01E-DE0C-4A43-B68D-900BABFE24B6@holtmann.org> (raw)
In-Reply-To: <20180209131028.16874-1-luiz.dentz@gmail.com>

Hi Luiz,

> Conditional jump or move depends on uninitialised value(s)
>  at 0x40208C: test_sample (test-ecc.c:106)
>  by 0x4022AB: test_invalid_pub (test-ecc.c:272)
>  by 0x406DA2: run_callback (tester.c:415)
>  by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x408245: tester_run (tester.c:830)
>  by 0x401CC3: main (test-ecc.c:291)
> 
> Conditional jump or move depends on uninitialised value(s)
>  at 0x4020D6: test_sample (test-ecc.c:113)
>  by 0x4022AB: test_invalid_pub (test-ecc.c:272)
>  by 0x406DA2: run_callback (tester.c:415)
>  by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3)
>  by 0x408245: tester_run (tester.c:830)
>  by 0x401CC3: main (test-ecc.c:291)
> ---
> unit/test-ecc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/unit/test-ecc.c b/unit/test-ecc.c
> index 98400a253..e0f9723fc 100644
> --- a/unit/test-ecc.c
> +++ b/unit/test-ecc.c
> @@ -91,7 +91,7 @@ static int test_sample(uint8_t priv_a[32], uint8_t priv_b[32],
> 				uint8_t pub_a[64], uint8_t pub_b[64],
> 				uint8_t dhkey[32])
> {
> -	uint8_t dhkey_a[32], dhkey_b[32];
> +	uint8_t dhkey_a[32] = {}, dhkey_b[32] = {};
> 	int fails = 0;

does an explicit memset also fixes this?

Regards

Marcel


  reply	other threads:[~2018-02-09 14:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 13:10 [PATCH BlueZ] unit/test-ecc: Fix uninitialised values Luiz Augusto von Dentz
2018-02-09 14:41 ` Marcel Holtmann [this message]
2018-02-12 11:29   ` Luiz Augusto von Dentz

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=2425F01E-DE0C-4A43-B68D-900BABFE24B6@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.