]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
BIO_send/recvmmsg(): Pass msgs_processed to the return callback
authorTomas Mraz <tomas@openssl.org>
Mon, 15 Dec 2025 10:41:38 +0000 (11:41 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 19 Dec 2025 15:38:07 +0000 (16:38 +0100)
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)

(cherry picked from commit 380ff1448596926fc9d252c8e4c2720b006ef912)

crypto/bio/bio_lib.c

index b95489ca9ef65e54276b39affd9b0e21b5415c81..8617ccb1b08bd43afa0ba5405c93e429549e0810 100644 (file)
@@ -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;
 }