]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proxy: fix clang build error on "add backend" handler
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 6 Feb 2026 20:11:37 +0000 (21:11 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 6 Feb 2026 20:17:18 +0000 (21:17 +0100)
This patch fixes the following compilation error :
  src/proxy.c:4954:12: error: format string is not a string literal
        (potentially insecure) [-Werror,-Wformat-security]
   4954 |         ha_notice(msg);
        |                   ^~~

No need to backport.

src/proxy.c

index 4a5ce7e17deda438424f259a9420f722ec3276b2..15a82918743a9a4011d9739e6d86b0e3cfbbe59b 100644 (file)
@@ -4939,10 +4939,10 @@ static int cli_parse_add_backend(char **args, char *payload, struct appctx *appc
        thread_release();
 
        if (unlikely(!be_supports_dynamic_srv(px, &msg)))
-               memprintf(&msg, "New backend registered (no support for dynamic servers: %s).\n", msg);
+               memprintf(&msg, "New backend registered (no support for dynamic servers: %s)", msg);
        else
-               memprintf(&msg, "New backend registered.\n");
-       ha_notice(msg);
+               memprintf(&msg, "New backend registered");
+       ha_notice("%s.\n", msg);
        ha_free(&msg);
        cli_umsg(appctx, LOG_INFO);