1
0
mirror of https://passt.top/passt synced 2024-07-02 07:52:41 +00:00

conf: Fix incorrect bounds checking for sock_path parameter

Looks like a copy-paste error where we're checking against the size of the
pcap field, rather than the sock_path field.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2022-08-23 16:31:49 +10:00 committed by Stefano Brivio
parent 7b710946b1
commit cc287af173

2
conf.c
View File

@ -1269,7 +1269,7 @@ void conf(struct ctx *c, int argc, char **argv)
ret = snprintf(c->sock_path, UNIX_SOCK_MAX - 1, "%s", ret = snprintf(c->sock_path, UNIX_SOCK_MAX - 1, "%s",
optarg); optarg);
if (ret <= 0 || ret >= (int)sizeof(c->pcap)) { if (ret <= 0 || ret >= (int)sizeof(c->sock_path)) {
err("Invalid socket path: %s", optarg); err("Invalid socket path: %s", optarg);
usage(argv[0]); usage(argv[0]);
} }