]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
libtommath: Make sure fast_s_mp_mul_digs initializes the W[] array
authorJouni Malinen <j@w1.fi>
Sat, 22 Jun 2019 15:42:53 +0000 (18:42 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 22 Jun 2019 15:56:44 +0000 (18:56 +0300)
Some compilers have started to warn about this and the use of two loops
with ix 0..pa-1 and 0..pa loop a bit suspicious, so better make sure the
array is initialized with zeros before extracting the terms from it.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/tls/libtommath.c

index 4f7a14823d725d6fc80877bad78ac07b385ac134..715674424324d9bad5621e24ebedadffeb0c5c83 100644 (file)
@@ -2441,6 +2441,7 @@ static int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
 
   /* clear the carry */
   _W = 0;
+  os_memset(W, 0, sizeof(W));
   for (ix = 0; ix < pa; ix++) {
       int      tx, ty;
       int      iy;