diff mbox series

[BlueZ,05/15] test-runner: Remove unused envp

Message ID 20240516090340.61417-6-hadess@hadess.net (mailing list archive)
State Accepted
Commit 9f4b2d0287ef1d4a70648250aeff0d8aa4f61ccc
Headers show
Series Fix a number of static analysis issues #2 | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint fail WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search 4: B1 Line exceeds max length (94>80): "bluez-5.75/tools/test-runner.c:644:2: var_decl: Declaring variable "envp" without initializer." 5: B1 Line exceeds max length (114>80): "bluez-5.75/tools/test-runner.c:682:3: uninit_use_in_call: Using uninitialized value "*envp" when calling "execve"." 7: B3 Line contains hard tab characters (\t): "681| if (pid == 0) {" 8: B3 Line contains hard tab characters (\t): "682|-> execve(argv[0], argv, envp);" 9: B3 Line contains hard tab characters (\t): "683| exit(EXIT_SUCCESS);" 10: B3 Line contains hard tab characters (\t): "684| }" 13: B1 Line exceeds max length (94>80): "bluez-5.75/tools/test-runner.c:701:2: var_decl: Declaring variable "envp" without initializer." 14: B1 Line exceeds max length (114>80): "bluez-5.75/tools/test-runner.c:739:3: uninit_use_in_call: Using uninitialized value "*envp" when calling "execve"." 16: B3 Line contains hard tab characters (\t): "738| if (pid == 0) {" 17: B3 Line contains hard tab characters (\t): "739|-> execve(argv[0], argv, envp);" 18: B3 Line contains hard tab characters (\t): "740| exit(EXIT_SUCCESS);" 19: B3 Line contains hard tab characters (\t): "741| }"
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Bastien Nocera May 16, 2024, 9:03 a.m. UTC
Error: UNINIT (CWE-457): [#def70] [important]
bluez-5.75/tools/test-runner.c:644:2: var_decl: Declaring variable "envp" without initializer.
bluez-5.75/tools/test-runner.c:682:3: uninit_use_in_call: Using uninitialized value "*envp" when calling "execve".
680|
681|	if (pid == 0) {
682|->		execve(argv[0], argv, envp);
683|		exit(EXIT_SUCCESS);
684|	}

Error: UNINIT (CWE-457): [#def71] [important]
bluez-5.75/tools/test-runner.c:701:2: var_decl: Declaring variable "envp" without initializer.
bluez-5.75/tools/test-runner.c:739:3: uninit_use_in_call: Using uninitialized value "*envp" when calling "execve".
737|
738|	if (pid == 0) {
739|->		execve(argv[0], argv, envp);
740|		exit(EXIT_SUCCESS);
741|	}
---
 tools/test-runner.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/test-runner.c b/tools/test-runner.c
index 5bdcf42fcd7a..134e26f9c691 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -641,7 +641,7 @@  static const char *monitor_table[] = {
 static pid_t start_btmon(const char *home)
 {
 	const char *monitor = NULL;
-	char *argv[3], *envp[2];
+	char *argv[3];
 	pid_t pid;
 	int i;
 
@@ -679,7 +679,7 @@  static pid_t start_btmon(const char *home)
 	}
 
 	if (pid == 0) {
-		execve(argv[0], argv, envp);
+		execv(argv[0], argv);
 		exit(EXIT_SUCCESS);
 	}