some problems reported by ccpcheck

This commit is contained in:
netblue30 2025-08-17 12:04:58 -04:00
parent e108976f5a
commit be3c2a0713
3 changed files with 11 additions and 11 deletions

View file

@ -376,7 +376,7 @@ extras: all
.PHONY: cppcheck
cppcheck:
$(CPPCHECK) --force --error-exitcode=1 --enable=warning,performance \
$(CPPCHECK) --force --error-exitcode=1 --enable=warning,performance --check-level=exhaustive \
-i src/firejail/checkcfg.c -i src/firejail/main.c .
.PHONY: scan-build

View file

@ -79,7 +79,7 @@ void run_symlink(int argc, char **argv, int run_as_is) {
if (env_get("LD_PRELOAD") != NULL)
fprintf(stderr, "run_symlink: LD_PRELOAD is: '%s'\n", env_get("LD_PRELOAD"));
assert(env_get("LD_PRELOAD") == NULL);
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
execvp(a[0], a);
perror("execvp");

View file

@ -330,7 +330,7 @@ void x11_start_xvfb(int argc, char **argv) {
// running without privileges - see drop_privs call above
assert(env_get("LD_PRELOAD") == NULL);
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
execvp(server_argv[0], server_argv);
perror("execvp");
_exit(1);
@ -371,7 +371,7 @@ void x11_start_xvfb(int argc, char **argv) {
// running without privileges - see drop_privs call above
assert(env_get("LD_PRELOAD") == NULL);
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
execvp(jail_argv[0], jail_argv);
perror("execvp");
_exit(1);
@ -567,7 +567,7 @@ void x11_start_xephyr(int argc, char **argv) {
// running without privileges - see drop_privs call above
assert(env_get("LD_PRELOAD") == NULL);
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
execvp(server_argv[0], server_argv);
perror("execvp");
_exit(1);
@ -608,7 +608,7 @@ void x11_start_xephyr(int argc, char **argv) {
env_apply_all();
// running without privileges - see drop_privs call above
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
assert(env_get("LD_PRELOAD") == NULL);
execvp(jail_argv[0], jail_argv);
perror("execvp");
@ -797,7 +797,7 @@ static void __attribute__((noreturn)) x11_start_xpra_old(int argc, char **argv,
env_apply_all();
// running without privileges - see drop_privs call above
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
assert(env_get("LD_PRELOAD") == NULL);
execvp(server_argv[0], server_argv);
perror("execvp");
@ -849,7 +849,7 @@ static void __attribute__((noreturn)) x11_start_xpra_old(int argc, char **argv,
// running without privileges - see drop_privs call above
assert(env_get("LD_PRELOAD") == NULL);
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
execvp(attach_argv[0], attach_argv);
perror("execvp");
_exit(1);
@ -879,7 +879,7 @@ static void __attribute__((noreturn)) x11_start_xpra_old(int argc, char **argv,
if (jail == 0) {
// running without privileges - see drop_privs call above
assert(env_get("LD_PRELOAD") == NULL);
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
// restore original environment variables
env_apply_all();
@ -915,7 +915,7 @@ static void __attribute__((noreturn)) x11_start_xpra_old(int argc, char **argv,
// running without privileges - see drop_privs call above
assert(env_get("LD_PRELOAD") == NULL);
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
execvp(stop_argv[0], stop_argv);
perror("execvp");
_exit(1);
@ -1087,7 +1087,7 @@ static void __attribute__((noreturn)) x11_start_xpra_new(int argc, char **argv,
// running without privileges - see drop_privs call above
assert(env_get("LD_PRELOAD") == NULL);
assert(getenv("LD_PRELOAD") == NULL);
assert(secure_getenv("LD_PRELOAD") == NULL);
execvp(server_argv[0], server_argv);
perror("execvp");
_exit(1);