From acb39e29c39aef9eefd44214d43ed9498828576d Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Sun, 7 Aug 2022 07:08:28 +0200 Subject: stack.c: add missing direct error reporting and improve coding style Doing so, had to fix sloppiness in using the stack API in crypto/conf/conf_def.c, ssl/ssl_ciph.c, ssl/statem/statem_srvr.c, and mostly in test/helpers/ssltestlib.c. Reviewed-by: Tomas Mraz Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/18918) (cherry picked from commit 30eba7f35983a917f1007bce45040c0af3442e42) --- ssl/ssl_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ssl/ssl_lib.c') diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 75ef563f1f..f32074b585 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -4987,7 +4987,8 @@ static int ct_move_scts(STACK_OF(SCT) **dst, STACK_OF(SCT) *src, } } - while ((sct = sk_SCT_pop(src)) != NULL) { + while (sk_SCT_num(src) > 0) { + sct = sk_SCT_pop(src); if (SCT_set_source(sct, origin) != 1) goto err; -- cgit v1.2.3