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