From 7e3cacac943d298348d97c8f7f980ca0916378c5 Mon Sep 17 00:00:00 2001 From: Todd Short Date: Mon, 29 Aug 2022 14:58:57 -0400 Subject: Update COMP_METHOD size_t-ify the COMP_METHOD structure and functions. Get rid of the non-functional COMP_METHODS and return NULL instead. Reviewed-by: Matt Caswell Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/18186) --- crypto/comp/comp_lib.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crypto/comp/comp_lib.c') diff --git a/crypto/comp/comp_lib.c b/crypto/comp/comp_lib.c index c5946fecdb..56ca17a7a5 100644 --- a/crypto/comp/comp_lib.c +++ b/crypto/comp/comp_lib.c @@ -19,6 +19,9 @@ COMP_CTX *COMP_CTX_new(COMP_METHOD *meth) { COMP_CTX *ret; + if (meth == NULL) + return NULL; + if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) return NULL; ret->meth = meth; @@ -36,11 +39,15 @@ const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx) int COMP_get_type(const COMP_METHOD *meth) { + if (meth == NULL) + return NID_undef; return meth->type; } const char *COMP_get_name(const COMP_METHOD *meth) { + if (meth == NULL) + return NULL; return meth->name; } -- cgit v1.2.3