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.
This commit is contained in:
Olivier Houchard 2023-04-08 14:58:53 +02:00
parent 7f2b3f9431
commit 0963b8a07f

View 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) { if (listener->bind_conf->options & BC_O_DEF_ACCEPT) {
struct accept_filter_arg accept; struct accept_filter_arg accept;
memset(&accept, 0, sizeof(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) { if (setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &accept, sizeof(accept)) == -1) {
chunk_appendf(msg, "%scannot enable ACCEPT_FILTER", msg->data ? ", " : ""); chunk_appendf(msg, "%scannot enable ACCEPT_FILTER", msg->data ? ", " : "");
err |= ERR_WARN; err |= ERR_WARN;