]> git.feebdaed.xyz Git - 0xmirror/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:36:03 +0000 (16:36 +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)

crypto/bio/bio_lib.c

index f89316b59f1c5aa37753aa77bc156a856f2ca57c..6b27a1c1d6981755b191528f4591328e85154dc4 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, (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;
 }