From 5e58733b23fd33f526fb95ae636daf7ebf023359 Mon Sep 17 00:00:00 2001 From: "Dr. Matthias St. Pierre" Date: Sun, 20 Oct 2019 13:10:38 +0200 Subject: [PATCH] ciphers/chacha20,poly1303: Fix two coverity errors CID 1454872, 1454873: Incorrect expression (SIZEOF_MISMATCH) Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10223) --- providers/implementations/ciphers/cipher_chacha20.c | 2 +- providers/implementations/ciphers/cipher_chacha20_poly1305.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/implementations/ciphers/cipher_chacha20.c b/providers/implementations/ciphers/cipher_chacha20.c index 7cc57e7043..d92fa08d0c 100644 --- a/providers/implementations/ciphers/cipher_chacha20.c +++ b/providers/implementations/ciphers/cipher_chacha20.c @@ -55,7 +55,7 @@ static void chacha20_freectx(void *vctx) PROV_CHACHA20_CTX *ctx = (PROV_CHACHA20_CTX *)vctx; if (ctx != NULL) { - OPENSSL_clear_free(ctx, sizeof(ctx)); + OPENSSL_clear_free(ctx, sizeof(*ctx)); } } diff --git a/providers/implementations/ciphers/cipher_chacha20_poly1305.c b/providers/implementations/ciphers/cipher_chacha20_poly1305.c index cc702cb8fc..b92d8d545e 100644 --- a/providers/implementations/ciphers/cipher_chacha20_poly1305.c +++ b/providers/implementations/ciphers/cipher_chacha20_poly1305.c @@ -66,7 +66,7 @@ static void chacha20_poly1305_freectx(void *vctx) PROV_CHACHA20_POLY1305_CTX *ctx = (PROV_CHACHA20_POLY1305_CTX *)vctx; if (ctx != NULL) - OPENSSL_clear_free(ctx, sizeof(ctx)); + OPENSSL_clear_free(ctx, sizeof(*ctx)); } static int chacha20_poly1305_get_params(OSSL_PARAM params[]) -- 2.25.1