]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: check applet_putchk() for 'show quic' first line
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Oct 2025 16:16:22 +0000 (18:16 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 17 Oct 2025 07:29:01 +0000 (09:29 +0200)
Ensure applet_putchk() return value is checked when outputing via the
CLI 'show quic' header line.

This is only to align with other usages of the same function, as trash
output buffer should always be large enough for it. As such, the command
is simply aborted if this is not the case.

This should fix coverity report from github issue #3139.

This could be backported up to 2.8.

src/quic_cli.c

index 1f22f8d0574c057f90d61bdc6757d342472723f2..2173d22d857aec8bacaecaf5153d2e45f6e1afff 100644 (file)
@@ -460,7 +460,10 @@ static int cli_io_handler_dump_quic(struct appctx *appctx)
                                      "in_flight infl_p lost_p         "
                                      "Local Address           Foreign Address      "
                                      "local & remote CIDs\n");
-                       applet_putchk(appctx, &trash);
+                       if (applet_putchk(appctx, &trash) == -1) {
+                               /* Trash buf too short without any data emitted yet, should never happen. */
+                               goto done;
+                       }
                }
        }