From: Dr. Matthias St. Pierre Date: Sun, 20 Oct 2019 11:10:38 +0000 (+0200) Subject: ciphers/chacha20,poly1303: Fix two coverity errors X-Git-Tag: openssl-3.0.0-alpha1~1100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e58733b23fd33f526fb95ae636daf7ebf023359;p=thirdparty%2Fopenssl.git 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) --- diff --git a/providers/implementations/ciphers/cipher_chacha20.c b/providers/implementations/ciphers/cipher_chacha20.c index 7cc57e7043d..d92fa08d0c2 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 cc702cb8fcc..b92d8d545ee 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[])