]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: correct errors about argument number in condition in cfgparse.c
authorErwan Le Goas <elegoas@haproxy.com>
Thu, 29 Sep 2022 08:30:00 +0000 (10:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Sep 2022 08:53:14 +0000 (10:53 +0200)
Put the right number in condition that takes the wrong number of arguments.

No backport needed, except if anonymization mechanism is backported.

src/cfgparse.c

index e6a6d30de6b7cdf9877e074971c38f81e6b66350..a2e86f518bf39895a216b64083c2e8de067ce990 100644 (file)
@@ -1963,10 +1963,10 @@ next_line:
                                else if (strcmp(args[0], "stats") == 0 && strcmp(args[1], "socket") == 0) {
                                        qfprintf(stdout, "%s %s ", args[0], args[1]);
 
-                                       if (arg > 1) {
+                                       if (arg > 2) {
                                                qfprintf(stdout, "%s ", hash_ipanon(g_key, args[2], 1));
 
-                                               if (arg > 2) {
+                                               if (arg > 3) {
                                                        qfprintf(stdout, "[...]\n");
                                                }
                                                else {