From: Anton Maklakov Date: Wed, 29 Aug 2018 04:55:07 +0000 (+0800) Subject: bluetooth: fix incorrect memset size X-Git-Tag: v3.2-beta1~260^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=779bce7681adb9d86bba6d19fc56e3d9e50cb131;p=esp-idf bluetooth: fix incorrect memset size --- diff --git a/components/bt/bluedroid/stack/smp/p_256_curvepara.c b/components/bt/bluedroid/stack/smp/p_256_curvepara.c index 1761d58483..0b79770563 100644 --- a/components/bt/bluedroid/stack/smp/p_256_curvepara.c +++ b/components/bt/bluedroid/stack/smp/p_256_curvepara.c @@ -41,8 +41,8 @@ void p_256_init_curve(UINT32 keyLength) ec->p[1] = 0xFFFFFFFF; ec->p[0] = 0xFFFFFFFF; - memset(ec->omega, 0, KEY_LENGTH_DWORDS_P256); - memset(ec->a, 0, KEY_LENGTH_DWORDS_P256); + memset(ec->omega, 0, KEY_LENGTH_DWORDS_P256 * sizeof(ec->omega[0])); + memset(ec->a, 0, KEY_LENGTH_DWORDS_P256 * sizeof(ec->a[0])); ec->a_minus3 = TRUE;