From: Tomas Mraz Date: Mon, 15 Dec 2025 10:41:38 +0000 (+0100) Subject: BIO_send/recvmmsg(): Pass msgs_processed to the return callback X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b693fcdc8f00ef89e63e0b81819f6e16abcc1bd4;p=thirdparty%2Fopenssl.git 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 Reviewed-by: Norbert Pocs (Merged from https://github.com/openssl/openssl/pull/29395) (cherry picked from commit 380ff1448596926fc9d252c8e4c2720b006ef912) --- diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c index b95489ca9ef..8617ccb1b08 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, ret, NULL); + (void *)&args, ret, 0, 0, (long)ret, msgs_processed); return ret; } @@ -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, ret, NULL); + (void *)&args, ret, 0, 0, (long)ret, msgs_processed); return ret; }