]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Fix a memory leak on duplicate Authentication Response
authorJouni Malinen <jouni@codeaurora.org>
Wed, 8 May 2019 17:25:10 +0000 (20:25 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 8 May 2019 17:25:10 +0000 (20:25 +0300)
Do not allow auth->peer_protocol_key to be overridden without having
freed the previously stored key in case two Authentication Response
messages are received.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/dpp.c

index fd2e9f4ce508f657fc17e9b41986463e932b1754..4b8d83811dbd9681f0f7e0f95165b983592399ee 100644 (file)
@@ -3753,6 +3753,7 @@ dpp_auth_resp_rx(struct dpp_authentication *auth, const u8 *hdr,
        }
        EVP_PKEY_CTX_free(ctx);
        ctx = NULL;
+       EVP_PKEY_free(auth->peer_protocol_key);
        auth->peer_protocol_key = pr;
        pr = NULL;