Check return code of BIO_ADDR_rawaddress

Fixes coverity issue: https://scan5.scan.coverity.com/#/project-view/64471/10222?selectedIssue=1666584
Thank you for the report!

Signed-off-by: Norbert Pocs <norbertp@openssl.org>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/28751)
This commit is contained in:
Norbert Pocs 2025-10-05 09:39:22 +02:00 committed by Neil Horman
parent f7feb2d937
commit 7fb9163586
1 changed files with 2 additions and 1 deletions

View File

@ -894,7 +894,8 @@ int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie,
buffer = app_malloc(length, "cookie generate buffer"); buffer = app_malloc(length, "cookie generate buffer");
memcpy(buffer, &port, sizeof(port)); memcpy(buffer, &port, sizeof(port));
BIO_ADDR_rawaddress(peer, buffer + sizeof(port), NULL); if (!BIO_ADDR_rawaddress(peer, buffer + sizeof(port), NULL))
goto end;
if (EVP_Q_mac(NULL, "HMAC", NULL, "SHA1", NULL, if (EVP_Q_mac(NULL, "HMAC", NULL, "SHA1", NULL,
cookie_secret, COOKIE_SECRET_LENGTH, buffer, length, cookie_secret, COOKIE_SECRET_LENGTH, buffer, length,