vquic: obey IOV_MAX

When using `recvmmsg()`, check `IOV_MAX` for limits to the iovec array
passed.

Reported-by: Teh Kok How
Fixes #16846
Closes #16849
This commit is contained in:
Stefan Eissing 2025-03-27 14:55:41 +01:00 committed by Daniel Stenberg
parent 0c1ad21f97
commit a910f5ba6a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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];