Quiet some clang 10 analyzer warnings.

This commit is contained in:
Todd C. Miller
2020-08-07 14:22:56 -06:00
parent 63dadad9df
commit fa5d44b8b5
8 changed files with 46 additions and 38 deletions

View File

@@ -480,6 +480,10 @@ selinux_execve(int fd, const char *path, char *const argv[], char *envp[],
*/
for (argc = 0; argv[argc] != NULL; argc++)
continue;
if (argc == 0) {
errno = EINVAL;
debug_return;
}
nargv = reallocarray(NULL, argc + 3, sizeof(char *));
if (nargv == NULL) {
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));