]> granicus.if.org Git - esp-idf/commitdiff
bluetooth: fix incorrect memset size
authorAnton Maklakov <anton@espressif.com>
Wed, 29 Aug 2018 04:55:07 +0000 (12:55 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Wed, 29 Aug 2018 06:40:28 +0000 (14:40 +0800)
components/bt/bluedroid/stack/smp/p_256_curvepara.c

index 1761d58483f868913e95daba344a82d02109d734..0b79770563cbfb8a072e18066308cece3aaf3736 100644 (file)
@@ -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;