From eb3d3f367ea09b89d54f177ded1e874611d1020f Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 5 Apr 2022 11:51:47 +0200 Subject: treewide: Argument cannot be negative, CWE-687 Actually harmless. Reported by Coverity. Signed-off-by: Stefano Brivio --- tap.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tap.c') diff --git a/tap.c b/tap.c index 8310891..8110577 100644 --- a/tap.c +++ b/tap.c @@ -803,6 +803,11 @@ static void tap_sock_unix_init(struct ctx *c) snprintf(path, UNIX_PATH_MAX, UNIX_SOCK_PATH, i); ex = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0); + if (ex < 0) { + perror("UNIX domain socket check"); + exit(EXIT_FAILURE); + } + ret = connect(ex, (const struct sockaddr *)&addr, sizeof(addr)); if (!ret || (errno != ENOENT && errno != ECONNREFUSED)) { if (*c->sock_path) { -- cgit v1.2.3