]> git.ipfire.org Git - thirdparty/openssl.git/commit
stack: use free thunk when deep copy cleanup fails
authorNikola Pajkovsky <nikolap@openssl.org>
Tue, 12 May 2026 09:32:10 +0000 (11:32 +0200)
committerNeil Horman <nhorman@openssl.org>
Wed, 20 May 2026 15:53:32 +0000 (11:53 -0400)
commit74edd30c9f6b3a583ca05fc97f296ddd0e161b78
treebd29810a2328cbe4f867d99ebe588e5bd9b8150c
parent0b555646d05439a5a3609474dde80a3c410cff76
stack: use free thunk when deep copy cleanup fails

internal_copy() used the generic OPENSSL_sk_freefunc directly when a deep
copy failed after copying some elements.  For typed stacks, callers pass
type-specific free callbacks that have been cast to OPENSSL_sk_freefunc, so
calling them through the generic function pointer type is undefined behavior.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Wed May 20 15:53:43 2026
(Merged from https://github.com/openssl/openssl/pull/31151)
crypto/stack/stack.c