]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: listeners: Use the right parameters for strlcpy2().
authorOlivier Houchard <cognet@ci0.org>
Sat, 8 Apr 2023 12:58:53 +0000 (14:58 +0200)
committerOlivier Houchard <cognet@ci0.org>
Sat, 8 Apr 2023 13:01:57 +0000 (15:01 +0200)
When calls to strcpy() were replaced with calls to strlcpy2(), one of them
was replaced wrong, and the source and size were inverted. Correct that.

This should fix issue #2110.

src/proto_tcp.c

index 30c2e11dd755a571c409ce28ea83c4a469a4ac31..4691e165a5cc68588baa3ea75d3ab571b9c6f41c 100644 (file)
@@ -709,7 +709,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
        if (listener->bind_conf->options & BC_O_DEF_ACCEPT) {
                struct accept_filter_arg accept;
                memset(&accept, 0, sizeof(accept));
-               strlcpy2(accept.af_name, sizeof(accept.af_name), "dataready");
+               strlcpy2(accept.af_name, "dataready", sizeof(accept.af_name));
                if (setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &accept, sizeof(accept)) == -1) {
                        chunk_appendf(msg, "%scannot enable ACCEPT_FILTER", msg->data ? ", " : "");
                        err |= ERR_WARN;