aboutgitcodebugslistschat
path: root/tap.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-04-05 11:51:47 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-04-07 11:44:35 +0200
commiteb3d3f367ea09b89d54f177ded1e874611d1020f (patch)
tree31fea867bba5f73506352c8a1188fa1309669cd2 /tap.c
parentbb76470090dc21540e70c3417fe0227c5a62cce2 (diff)
downloadpasst-eb3d3f367ea09b89d54f177ded1e874611d1020f.tar
passt-eb3d3f367ea09b89d54f177ded1e874611d1020f.tar.gz
passt-eb3d3f367ea09b89d54f177ded1e874611d1020f.tar.bz2
passt-eb3d3f367ea09b89d54f177ded1e874611d1020f.tar.lz
passt-eb3d3f367ea09b89d54f177ded1e874611d1020f.tar.xz
passt-eb3d3f367ea09b89d54f177ded1e874611d1020f.tar.zst
passt-eb3d3f367ea09b89d54f177ded1e874611d1020f.zip
treewide: Argument cannot be negative, CWE-687
Actually harmless. Reported by Coverity. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tap.c')
-rw-r--r--tap.c5
1 files changed, 5 insertions, 0 deletions
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) {