Welcome! Log In Create A New Profile

Advanced

[nginx-quic] fix the infinite loop issue for quic branch

Yu Liu (刘宇)(FU-IBU)(国际业务研发部)
May 20, 2021 06:02AM
Hi Team,

We tried nginx-quic on our server and found a problem. Please refer to the changeset below.

Regards,
Yu Liu


# HG changeset patch
# User Yu Liu <liu.yub@trip.com<mailto:liu.yub@trip.com>>
# Date 1621502282 -28800
# Thu May 20 17:18:02 2021 +0800
# Branch quic
# Node ID 4055a366b23e29215f3b4eb1d104303e33266cd4
# Parent 557dc6a06ba6ea7e78444067c4b8fbb022f7b191
Fix the infinite loop issue

When bits is greater than or equal to 3, value is always shifted 62 bits to the right. So when the input number is greater than 2 to the power of 62, this method will loop endlessly.

diff -r 557dc6a06ba6 -r 4055a366b23e src/event/quic/ngx_event_quic_transport.c
--- a/src/event/quic/ngx_event_quic_transport.c Tue May 18 18:17:25 2021 +0300
+++ b/src/event/quic/ngx_event_quic_transport.c Thu May 20 17:18:02 2021 +0800
@@ -250,7 +250,7 @@
ngx_uint_t bits;

bits = 0;
- while (value >> ((8 << bits) - 2)) {
+ while (bits <=3 && (value >> ((8 << bits) - 2))) {
bits++;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx-quic] fix the infinite loop issue for quic branch

Yu Liu (刘宇)(FU-IBU)(国际业务研发部) 426 May 20, 2021 06:02AM

Re: [nginx-quic] fix the infinite loop issue for quic branch

Sergey Kandaurov 172 May 24, 2021 11:46AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 215
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready