summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_lib.c
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-10-12 10:36:20 +0200
committerTomas Mraz <tomas@openssl.org>2022-10-21 18:02:35 +0200
commita8086e6bfc37355626393751a94bc5c92df7e9d3 (patch)
treed702fc114219808d8c123ef5284f3be1e84abecf /ssl/ssl_lib.c
parentfba324204f3bdd8ba9e99d42db030aaf6482d896 (diff)
stack: Do not add error if pop/shift/value accesses outside of the stack
This partially reverts commit 30eba7f35983a917f1007bce45040c0af3442e42. This is legitimate use of the stack functions and no error should be reported apart from the NULL return value. Fixes #19389 Reviewed-by: Todd Short <todd.short@me.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19400)
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r--ssl/ssl_lib.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index b2a68c9f34..3b3eda4001 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -5787,8 +5787,7 @@ static int ct_move_scts(STACK_OF(SCT) **dst, STACK_OF(SCT) *src,
}
}
- while (sk_SCT_num(src) > 0) {
- sct = sk_SCT_pop(src);
+ while ((sct = sk_SCT_pop(src)) != NULL) {
if (SCT_set_source(sct, origin) != 1)
goto err;