From 36f0199f6ef4183837ae72551a778a4054de43fd Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 16 Feb 2023 19:19:23 +0100 Subject: conf, tap: Silence two false positive invalidFunctionArg from cppcheck The newly introduced die() calls exit(), but cppcheck doesn't see it and warns about possibly invalid arguments used after the check which triggers die(). Add return statements to silence the warnings. Signed-off-by: Stefano Brivio --- conf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 675d961..5426c9b 100644 --- a/conf.c +++ b/conf.c @@ -1036,6 +1036,9 @@ static void conf_ugid(char *runas, uid_t *uid, gid_t *gid) if ((fd = open("/proc/self/uid_map", O_RDONLY | O_CLOEXEC)) < 0) { die("Can't determine if we're in init namespace: %s", strerror(errno)); + + /* Silence cppcheck's invalidFunctionArg for 'fd' in read() */ + return; } if (read(fd, buf, BUFSIZ) != sizeof(root_uid_map) || -- cgit v1.2.3