From: Matt Caswell Date: Wed, 29 Dec 2021 13:42:58 +0000 (+0000) Subject: Validate the category in OSSL_trace_end() X-Git-Tag: openssl-3.2.0-alpha1~3148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee8a61e158c42c327c3303101083422b9a7cc504;p=thirdparty%2Fopenssl.git Validate the category in OSSL_trace_end() OSSL_trace_end() should validate that the category it has been passed by the caler is valid, and return immediately if not. Fixes #17353 Reviewed-by: Tomas Mraz Reviewed-by: Tim Hudson Reviewed-by: Matthias St. Pierre Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/17371) --- diff --git a/crypto/trace.c b/crypto/trace.c index f012b617abc..cc0b4776986 100644 --- a/crypto/trace.c +++ b/crypto/trace.c @@ -496,6 +496,8 @@ void OSSL_trace_end(int category, BIO * channel) char *suffix = NULL; category = ossl_trace_get_category(category); + if (category < 0) + return; suffix = trace_channels[category].suffix; if (channel != NULL && ossl_assert(channel == current_channel)) {