]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfSSL: Fix crypto_hash_init() memory clearing
authorSean Parkinson <sean@wolfssl.com>
Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)
committerJouni Malinen <j@w1.fi>
Wed, 2 May 2018 10:32:51 +0000 (13:32 +0300)
Explicitly clear the allocated memory to avoid uninitialized data in
struct crypto_hash.

Signed-off-by: Sean Parkinson <sean@wolfssl.com>
src/crypto/crypto_wolfssl.c

index 2fce6b84d4d850e499adb4d9f0887d34c9d9b0a9..e29a6f5548aa52bca48b7a51e3b032b44f9edc79 100644 (file)
@@ -889,7 +889,7 @@ struct crypto_hash * crypto_hash_init(enum crypto_hash_alg alg, const u8 *key,
        struct crypto_hash *hash;
        int type;
 
-       hash = os_malloc(sizeof(*hash));
+       hash = os_zalloc(sizeof(*hash));
        if (!hash)
                goto done;