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 <[email protected]<mailto:[email protected]>>
# 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
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-devel
  • [nginx-quic] fi... Yu Liu (刘宇)(FU-IBU)(国际业务研发部)

Reply via email to