]> git.ipfire.org Git - thirdparty/openssl.git/commit
ssl: fix OOB write in SSL_get_shared_ciphers when no shared ciphers
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Wed, 8 Oct 2025 22:14:15 +0000 (06:14 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 17 Oct 2025 16:54:28 +0000 (18:54 +0200)
commit680491a2a7403fc6e5e1759e0eabeceeacaf37f9
tree99b4a590853fa7318aa95912b518048ca7008867
parent552374022fb19570bcc8f9ed1e55ee8910df3cda
ssl: fix OOB write in SSL_get_shared_ciphers when no shared ciphers

When no cipher names are appended, p remains at buf and the unconditional
p[-1] = '\0' underflows. Only NUL-terminate if at least one cipher was written;
otherwise return an empty string safely.

Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28785)
ssl/ssl_lib.c