]> git.kaiwu.me - nginx.git/commitdiff
QUIC: always populate ngx_quic_cbs_recv_rcd() output arguments
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 15 Apr 2026 18:12:28 +0000 (22:12 +0400)
committerSergey Kandaurov <s.kandaurov@f5.com>
Thu, 16 Apr 2026 11:25:55 +0000 (15:25 +0400)
Although uninitialized values aren't used in practice due to the
nature of the OpenSSL code flow, this violates the API contract.

Reported by lukefr09 on GitHub.

src/event/quic/ngx_event_quic_ssl.c

index 18992ae1be6fc18d440f2cb19dd3788d8210c3c0..4e84f8102733444320d7029998c60c1581f9a72f 100644 (file)
@@ -158,6 +158,7 @@ ngx_quic_cbs_recv_rcd(ngx_ssl_conn_t *ssl_conn,
         if (b->sync) {
             /* hole */
 
+            *data = NULL;
             *bytes_read = 0;
 
             break;
@@ -169,6 +170,9 @@ ngx_quic_cbs_recv_rcd(ngx_ssl_conn_t *ssl_conn,
         break;
     }
 
+    *data = NULL;
+    *bytes_read = 0;
+
     return 1;
 }