From a9acf74ecf10f64a59557519f5e9bed847e84b38 Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Mon, 15 Sep 2025 05:27:58 +0200 Subject: [PATCH] test/radix/terp.c: avoid accessing uninitialised terp on error Stats printing in TERP_run() assumes that terp has been initialised, which is not the case when a jump to the err label has been performed before successful TERP_init() call; avoid it by enframing the offending call within a have_terp guard check. Fixes: 4a2d5fe812f8 "QUIC RADIX: Add RADIX test framework implementation" Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665430 References: https://github.com/openssl/project/issues/1432 Signed-off-by: Eugene Syromiatnikov Reviewed-by: Paul Dale Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/28647) (cherry picked from commit 84432e9b6cb88767a8225a53baa812efd22aaa1b) --- test/radix/terp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/radix/terp.c b/test/radix/terp.c index 3c83fd9b18b..41d3bdeb9fd 100644 --- a/test/radix/terp.c +++ b/test/radix/terp.c @@ -871,8 +871,10 @@ err: } GEN_SCRIPT_cleanup(&gen_script); - BIO_printf(debug_bio, "Stats:\n Ops executed: %16llu\n\n", - (unsigned long long)terp.ops_executed); + if (have_terp) { + BIO_printf(debug_bio, "Stats:\n Ops executed: %16llu\n\n", + (unsigned long long)terp.ops_executed); + } SCRIPT_INFO_print(script_info, debug_bio, /*error=*/!ok, ok ? "completed" : "failed, exiting"); return ok; -- 2.47.3