From 0963b8a07f13094dd7ae8e05ad3b0aca1b6a6bc1 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Sat, 8 Apr 2023 14:58:53 +0200 Subject: [PATCH] BUG/MEDIUM: listeners: Use the right parameters for strlcpy2(). 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 30c2e11dd..4691e165a 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -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;