Blame SOURCES/0269-lib-spawn-Explicitly-initialize-array.patch
|
|
b12e4c |
From 0eb1bff4cf000777734e611f9673e18a868d25b1 Mon Sep 17 00:00:00 2001
|
|
|
b12e4c |
From: Ernestas Kulik <ekulik@redhat.com>
|
|
|
b12e4c |
Date: Mon, 10 Jun 2019 15:19:00 +0200
|
|
|
b12e4c |
Subject: [PATCH] lib: spawn: Explicitly initialize array
|
|
|
b12e4c |
MIME-Version: 1.0
|
|
|
b12e4c |
Content-Type: text/plain; charset=UTF-8
|
|
|
b12e4c |
Content-Transfer-Encoding: 8bit
|
|
|
b12e4c |
|
|
|
b12e4c |
Clang seems to think that the call just after declaring it doesn’t
|
|
|
b12e4c |
set any values.
|
|
|
b12e4c |
|
|
|
b12e4c |
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
|
|
|
b12e4c |
---
|
|
|
b12e4c |
src/lib/spawn.c | 5 ++++-
|
|
|
b12e4c |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
b12e4c |
|
|
|
b12e4c |
diff --git a/src/lib/spawn.c b/src/lib/spawn.c
|
|
|
b12e4c |
index 7effe5c..c52cbf7 100644
|
|
|
b12e4c |
--- a/src/lib/spawn.c
|
|
|
b12e4c |
+++ b/src/lib/spawn.c
|
|
|
b12e4c |
@@ -160,7 +160,10 @@ char *run_in_shell_and_save_output(int flags,
|
|
|
b12e4c |
flags &= ~EXECFLG_INPUT;
|
|
|
b12e4c |
|
|
|
b12e4c |
const char *argv[] = { "/bin/sh", "-c", cmd, NULL };
|
|
|
b12e4c |
- int pipeout[2];
|
|
|
b12e4c |
+ /* Clang seems to think that pipeout[0] is uninitialized when calling
|
|
|
b12e4c |
+ * safe_read().
|
|
|
b12e4c |
+ */
|
|
|
b12e4c |
+ int pipeout[2] = { 0 };
|
|
|
b12e4c |
pid_t child = fork_execv_on_steroids(flags, (char **)argv, pipeout,
|
|
|
b12e4c |
/*env_vec:*/ NULL, dir, /*uid (unused):*/ 0);
|
|
|
b12e4c |
|
|
|
b12e4c |
--
|
|
|
b12e4c |
2.21.0
|
|
|
b12e4c |
|