summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorChris Luke <chrisy@flirble.org>2017-09-07 07:40:13 -0400
committerDave Wallace <dwallacelf@gmail.com>2017-09-08 02:17:27 +0000
commitab7b8d93cf1098970bc17fb4937376bb1ff33a21 (patch)
treeb1c0c89e34cb87f6cd8c1f783654bf66c7b50ac9 /src/vppinfra
parent8a19f12a0cfe6d611f6e266931af691fb69a74ad (diff)
Fixes for issues reported by Coverity (VPP-972)
Change-Id: I25238debb7081b4467aec4620dfdef33fbef3295 Signed-off-by: Chris Luke <chrisy@flirble.org>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/socket.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/vppinfra/socket.c b/src/vppinfra/socket.c
index 7ade440c51c..37dcbbfd8c6 100644
--- a/src/vppinfra/socket.c
+++ b/src/vppinfra/socket.c
@@ -359,9 +359,21 @@ clib_socket_init (clib_socket_t * s)
&& s->flags & SOCKET_ALLOW_GROUP_WRITE)
{
struct stat st = { 0 };
- stat (((struct sockaddr_un *) &addr)->sun_path, &st);
+ if (stat (((struct sockaddr_un *) &addr)->sun_path, &st) < 0)
+ {
+ error = clib_error_return_unix (0, "stat (fd %d, '%s')",
+ s->fd, s->config);
+ goto done;
+ }
st.st_mode |= S_IWGRP;
- chmod (((struct sockaddr_un *) &addr)->sun_path, st.st_mode);
+ if (chmod (((struct sockaddr_un *) &addr)->sun_path, st.st_mode) <
+ 0)
+ {
+ error =
+ clib_error_return_unix (0, "chmod (fd %d, '%s', mode %o)",
+ s->fd, s->config, st.st_mode);
+ goto done;
+ }
}
}
else