]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vquic: obey IOV_MAX
authorStefan Eissing <stefan@eissing.org>
Thu, 27 Mar 2025 13:55:41 +0000 (14:55 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 27 Mar 2025 21:53:01 +0000 (22:53 +0100)
When using `recvmmsg()`, check `IOV_MAX` for limits to the iovec array
passed.

Reported-by: Teh Kok How
Fixes #16846
Closes #16849

lib/vquic/vquic.c

index 1e7a258b612d1ae1ed8c60c8c9383bf785d025a3..eb08ce7a220a15b6881a8abdc8f400922a3916d3 100644 (file)
@@ -379,7 +379,7 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf,
 
   total_nread = 0;
   while(pkts < max_pkts) {
-    n = (int)CURLMIN(MMSG_NUM, max_pkts);
+    n = (int)CURLMIN(CURLMIN(MMSG_NUM, IOV_MAX), max_pkts);
     memset(&mmsg, 0, sizeof(mmsg));
     for(i = 0; i < n; ++i) {
       msg_iov[i].iov_base = bufs[i];