Commit dd6c536ba9 for openssl.org
commit dd6c536ba96147082c18c0ce6e1bb69961e80e3a
Author: Norbert Pocs <norbertp@openssl.org>
Date: Wed Sep 2 15:26:51 2026 +0200
Check return code of BIO_ADDR_rawmake
Resolves coverity issue 1700561.
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Jakub Zelenka <jakub.zelenka@openssl.foundation>
Merge-date: Wed Sep 16 09:11:08 2026
Merged-from: https://github.com/openssl/openssl/pull/32661
diff --git a/crypto/bio/bio_addr.c b/crypto/bio/bio_addr.c
index 363d2ad3c6..f1adbf99b4 100644
--- a/crypto/bio/bio_addr.c
+++ b/crypto/bio/bio_addr.c
@@ -630,7 +630,12 @@ static int addrinfo_wrap(int family, int socktype,
all right. */
BIO_ADDR *addr = BIO_ADDR_new();
if (addr != NULL) {
- BIO_ADDR_rawmake(addr, family, where, wherelen, port);
+ if (!BIO_ADDR_rawmake(addr, family, where, wherelen, port)) {
+ BIO_ADDR_free(addr);
+ BIO_ADDRINFO_free(*bai);
+ *bai = NULL;
+ return 0;
+ }
(*bai)->bai_addr = BIO_ADDR_sockaddr_noconst(addr);
}
}