Commit 380ff14485 for openssl.org
commit 380ff1448596926fc9d252c8e4c2720b006ef912
Author: Tomas Mraz <tomas@openssl.org>
Date: Mon Dec 15 11:41:38 2025 +0100
BIO_send/recvmmsg(): Pass msgs_processed to the return callback
This avoids crash if a legacy BIO callback is set and
BIO_sendmmsg() or BIO_recvmmsg() is used.
Reported by Stanislav Fort (Aisle Research)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29395)
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index f89316b59f..6b27a1c1d6 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -429,7 +429,7 @@ int BIO_sendmmsg(BIO *b, BIO_MSG *msg,
if (HAS_CALLBACK(b))
ret = (size_t)bio_call_callback(b, BIO_CB_SENDMMSG | BIO_CB_RETURN,
- (void *)&args, ret, 0, 0, (long)ret, NULL);
+ (void *)&args, ret, 0, 0, (long)ret, msgs_processed);
return ret > 0;
}
@@ -476,7 +476,7 @@ int BIO_recvmmsg(BIO *b, BIO_MSG *msg,
if (HAS_CALLBACK(b))
ret = (size_t)bio_call_callback(b, BIO_CB_RECVMMSG | BIO_CB_RETURN,
- (void *)&args, ret, 0, 0, (long)ret, NULL);
+ (void *)&args, ret, 0, 0, (long)ret, msgs_processed);
return ret > 0;
}