From: Olivier Houchard Date: Sat, 8 Apr 2023 12:58:53 +0000 (+0200) Subject: BUG/MEDIUM: listeners: Use the right parameters for strlcpy2(). X-Git-Tag: v2.8-dev7~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0963b8a07f13094dd7ae8e05ad3b0aca1b6a6bc1;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 30c2e11dd7..4691e165a5 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;