From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH 1/3] conf: Fix incorrect bounds checking for sock_path parameter Date: Tue, 23 Aug 2022 16:31:49 +1000 Message-ID: <20220823063151.854034-2-david@gibson.dropbear.id.au> In-Reply-To: <20220823063151.854034-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7285437715268017090==" --===============7285437715268017090== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 --- conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]); } -- 2.37.2 --===============7285437715268017090==--