Quiet some harmless PVS-Studio warnings.
This commit is contained in:
@@ -1022,15 +1022,15 @@ run_command(struct command_details *details)
|
|||||||
cstat.val = 0;
|
cstat.val = 0;
|
||||||
|
|
||||||
if (details->command == NULL) {
|
if (details->command == NULL) {
|
||||||
sudo_warnx(U_("command not set by the security policy"));
|
sudo_warnx("%s", U_("command not set by the security policy"));
|
||||||
debug_return_int(status);
|
debug_return_int(status);
|
||||||
}
|
}
|
||||||
if (details->argv == NULL) {
|
if (details->argv == NULL) {
|
||||||
sudo_warnx(U_("argv not set by the security policy"));
|
sudo_warnx("%s", U_("argv not set by the security policy"));
|
||||||
debug_return_int(status);
|
debug_return_int(status);
|
||||||
}
|
}
|
||||||
if (details->envp == NULL) {
|
if (details->envp == NULL) {
|
||||||
sudo_warnx(U_("envp not set by the security policy"));
|
sudo_warnx("%s", U_("envp not set by the security policy"));
|
||||||
debug_return_int(status);
|
debug_return_int(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -315,13 +315,11 @@ send_policy_check_req(int sock, const char *cmnd, char * const argv[],
|
|||||||
req.intercept_fd = sock;
|
req.intercept_fd = sock;
|
||||||
req.command = (char *)cmnd;
|
req.command = (char *)cmnd;
|
||||||
req.argv = argv ? (char **)argv : empty;
|
req.argv = argv ? (char **)argv : empty;
|
||||||
req.n_argv = 0;
|
for (req.n_argv = 0; req.argv[req.n_argv] != NULL; req.n_argv++)
|
||||||
while (req.argv[req.n_argv] != NULL)
|
continue;
|
||||||
req.n_argv++;
|
|
||||||
req.envp = envp ? (char **)envp : empty;
|
req.envp = envp ? (char **)envp : empty;
|
||||||
req.n_envp = 0;
|
for (req.n_envp = 0; req.envp[req.n_envp] != NULL; req.n_envp++)
|
||||||
while (req.envp[req.n_envp] != NULL)
|
continue;
|
||||||
req.n_envp++;
|
|
||||||
if (getcwd(cwdbuf, sizeof(cwdbuf)) != NULL) {
|
if (getcwd(cwdbuf, sizeof(cwdbuf)) != NULL) {
|
||||||
req.cwd = cwdbuf;
|
req.cwd = cwdbuf;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user