mirror of
https://github.com/curl/curl.git
synced 2026-06-15 03:45:38 +03:00
quic: count zero length packets against max
With a flood of zero lenght UDP packets to curl, the receive loop might run longer than intended to. Count such packets against the max to terminate the loop as intended. URL: https://hackerone.com/reports/3783438 Reported-by: vectorqueue on hackerone Closes #21869
This commit is contained in:
parent
c32427d0c1
commit
56eca2afb4
1 changed files with 6 additions and 2 deletions
|
|
@ -508,8 +508,10 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf,
|
|||
VERBOSE(++calls);
|
||||
for(i = 0; i < mcount; ++i) {
|
||||
/* A zero-length UDP packet is no QUIC packet. Ignore. */
|
||||
if(!mmsg[i].msg_len)
|
||||
if(!mmsg[i].msg_len) {
|
||||
++pkts;
|
||||
continue;
|
||||
}
|
||||
total_nread += mmsg[i].msg_len;
|
||||
|
||||
gso_size = vquic_msghdr_get_udp_gro(&mmsg[i].msg_hdr);
|
||||
|
|
@ -593,8 +595,10 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf,
|
|||
++calls;
|
||||
|
||||
/* A 0-length UDP packet is no QUIC packet */
|
||||
if(!nread)
|
||||
if(!nread) {
|
||||
++pkts;
|
||||
continue;
|
||||
}
|
||||
|
||||
gso_size = vquic_msghdr_get_udp_gro(&msg);
|
||||
if(gso_size == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue