]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: mux_quic: fix uninit for QMux emission
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 2 Apr 2026 14:54:27 +0000 (16:54 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 2 Apr 2026 14:58:00 +0000 (16:58 +0200)
Fix the following build warning from obsolete compilers for <orig_frm>
variable in qcc_qstrm_send_frames() function :

src/mux_quic_qstrm.c:266:17: warning: 'orig_frm' may be used
  uninitialized in this function [-Wmaybe-uninitialized]

The variable is now explicitely initialized to NULL on each loop, which
should prevent this warning. Note that for code clarity, the variable is
renamed <next_frm>.

No need to backport.

src/mux_quic_qstrm.c

index be75165541c8c70cab0d8fcdd554e6b21b9d44ce..4d6107c0d3328c26888976d7eb3cf4baceb6741a 100644 (file)
@@ -223,7 +223,7 @@ int qcc_qstrm_send_frames(struct qcc *qcc, struct list *frms)
 {
        struct connection *conn = qcc->conn;
        struct quic_frame *frm, *frm_old;
-       struct quic_frame *split_frm, *orig_frm;
+       struct quic_frame *split_frm, *next_frm;
        struct buffer *buf = &qcc->tx.qstrm_buf;
        unsigned char *pos, *old, *end;
        size_t ret;
@@ -246,7 +246,7 @@ int qcc_qstrm_send_frames(struct qcc *qcc, struct list *frms)
        b_reset(buf);
        list_for_each_entry_safe(frm, frm_old, frms, list) {
  loop:
-               split_frm = NULL;
+               split_frm = next_frm = NULL;
                b_reset(buf);
                old = pos = (unsigned char *)b_orig(buf);
                end = (unsigned char *)b_wrap(buf);
@@ -269,7 +269,7 @@ int qcc_qstrm_send_frames(struct qcc *qcc, struct list *frms)
                                        continue;
                                }
 
-                               orig_frm = frm;
+                               next_frm = frm;
                                frm = split_frm;
                        }
                }
@@ -297,7 +297,7 @@ int qcc_qstrm_send_frames(struct qcc *qcc, struct list *frms)
 
                LIST_DEL_INIT(&frm->list);
                if (split_frm) {
-                       frm = orig_frm;
+                       frm = next_frm;
                        goto loop;
                }
        }