From 069617fdcecf472ea60526c263100248cf2e3036 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 19 Jun 2025 23:56:09 +0200 Subject: [PATCH] library: debug: improve input param check in mbedtls_debug_print_psa_rsa() Signed-off-by: Valerio Setti --- library/debug.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/debug.c b/library/debug.c index 9ded720749..20ef3fd879 100644 --- a/library/debug.c +++ b/library/debug.c @@ -333,6 +333,13 @@ static void mbedtls_debug_print_psa_rsa(const mbedtls_ssl_context *ssl, int leve size_t len, bits; int ret; + if (NULL == ssl || + NULL == ssl->conf || + NULL == ssl->conf->f_dbg || + level > debug_threshold) { + return; + } + if (pk->pub_raw_len > sizeof(key_der)) { return; }