aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls
diff options
context:
space:
mode:
authorMaks Naumov <maksqwe1@ukr.net>2015-05-02 20:21:37 (GMT)
committerJouni Malinen <j@w1.fi>2015-05-03 13:53:59 (GMT)
commit74d912f134984fac1a5d95ed001af1564a1191fc (patch)
tree3b334f230da633173992343aba0c8c8ade08595a /src/tls
parentfd66aa63f4390b9a6155a9b6fd9ebcb37e7290dd (diff)
downloadhostap-74d912f134984fac1a5d95ed001af1564a1191fc.zip
hostap-74d912f134984fac1a5d95ed001af1564a1191fc.tar.gz
hostap-74d912f134984fac1a5d95ed001af1564a1191fc.tar.bz2
libtommath: Fix check mp_init_multi() result
If the mp_init_multi() call had failed due to memory allocation failure, mp_div() would have returned 1 instead of MP_MEM (-2). It looks like all callers are checking the return value against MP_OKAY instead of <1 (etc.), so this does not seem to result in difference in behavior. Anyway, it's best to fix the mp_div() return value for the MP_MEM error case to avoid unexpected behavior. Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Diffstat (limited to 'src/tls')
-rw-r--r--src/tls/libtommath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tls/libtommath.c b/src/tls/libtommath.c
index 3fb8fbe..251133e 100644
--- a/src/tls/libtommath.c
+++ b/src/tls/libtommath.c
@@ -1631,7 +1631,7 @@ static int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d)
}
/* init our temps */
- if ((res = mp_init_multi(&ta, &tb, &tq, &q, NULL) != MP_OKAY)) {
+ if ((res = mp_init_multi(&ta, &tb, &tq, &q, NULL)) != MP_OKAY) {
return res;
}