summaryrefslogtreecommitdiffstats
path: root/crypto/comp/comp_lib.c
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2022-08-29 14:58:57 -0400
committerTodd Short <todd.short@me.com>2022-10-18 09:30:22 -0400
commit7e3cacac943d298348d97c8f7f980ca0916378c5 (patch)
tree23add0038a61ce3ee2a0c6ec6f5c04c96a74f948 /crypto/comp/comp_lib.c
parentb540aae97d6b80f9040874b9c56259a85ba46f36 (diff)
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 <matt@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18186)
Diffstat (limited to 'crypto/comp/comp_lib.c')
-rw-r--r--crypto/comp/comp_lib.c7
1 files changed, 7 insertions, 0 deletions
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;
}