aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-08-23 16:31:49 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-08-24 18:01:48 +0200
commitcc287af173ca5fd154bc28be5c9babcb14ce4363 (patch)
tree58f965756302ac2d973b429e4c1f53ed832f7a0f /conf.c
parent7b710946b152fabab0f3c838e5518576beb9020c (diff)
downloadpasst-cc287af173ca5fd154bc28be5c9babcb14ce4363.tar
passt-cc287af173ca5fd154bc28be5c9babcb14ce4363.tar.gz
passt-cc287af173ca5fd154bc28be5c9babcb14ce4363.tar.bz2
passt-cc287af173ca5fd154bc28be5c9babcb14ce4363.tar.lz
passt-cc287af173ca5fd154bc28be5c9babcb14ce4363.tar.xz
passt-cc287af173ca5fd154bc28be5c9babcb14ce4363.tar.zst
passt-cc287af173ca5fd154bc28be5c9babcb14ce4363.zip
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>
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/conf.c b/conf.c
index 83b2fe5..ac81c15 100644
--- a/conf.c
+++ b/conf.c
@@ -1269,7 +1269,7 @@ void conf(struct ctx *c, int argc, char **argv)
ret = snprintf(c->sock_path, UNIX_SOCK_MAX - 1, "%s",
optarg);
- if (ret <= 0 || ret >= (int)sizeof(c->pcap)) {
+ if (ret <= 0 || ret >= (int)sizeof(c->sock_path)) {
err("Invalid socket path: %s", optarg);
usage(argv[0]);
}