aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-19 19:18:04 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-20 08:29:30 +0200
commitb0b77118fee59b0db6eb3823b0191d9cd0ef9fc6 (patch)
treef4494fee397426916a5b7cdaecab9d79232f8e75 /conf.c
parent1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc (diff)
downloadpasst-b0b77118fee59b0db6eb3823b0191d9cd0ef9fc6.tar
passt-b0b77118fee59b0db6eb3823b0191d9cd0ef9fc6.tar.gz
passt-b0b77118fee59b0db6eb3823b0191d9cd0ef9fc6.tar.bz2
passt-b0b77118fee59b0db6eb3823b0191d9cd0ef9fc6.tar.lz
passt-b0b77118fee59b0db6eb3823b0191d9cd0ef9fc6.tar.xz
passt-b0b77118fee59b0db6eb3823b0191d9cd0ef9fc6.tar.zst
passt-b0b77118fee59b0db6eb3823b0191d9cd0ef9fc6.zip
passt: Address warnings from Clang's scan-build
All false positives so far. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/conf.c b/conf.c
index 8e96368..d7ddfd7 100644
--- a/conf.c
+++ b/conf.c
@@ -323,7 +323,9 @@ static void get_dns(struct ctx *c)
if (end)
*end = 0;
- p = strtok(buf, " \t");
+ if (!strtok(buf, " \t"))
+ continue;
+
while (s - c->dns_search < ARRAY_SIZE(c->dns_search) - 1
&& (p = strtok(NULL, " \t"))) {
strncpy(s->n, p, sizeof(c->dns_search[0]));
@@ -371,7 +373,7 @@ static int conf_ns_opt(struct ctx *c,
char *nsdir, char *conf_userns, const char *optarg)
{
int ufd = 0, nfd = 0, try, ret, netns_only_reset = c->netns_only;
- char userns[PATH_MAX], netns[PATH_MAX];
+ char userns[PATH_MAX] = { 0 }, netns[PATH_MAX];
char *endptr;
pid_t pid;