diff mbox

[v9,05.5/17] fixup to qapi: Unbox base members

Message ID 1445022763-26469-1-git-send-email-eblake@redhat.com
State New
Headers show

Commit Message

Eric Blake Oct. 16, 2015, 7:12 p.m. UTC
valgrind reports that our testsuite is making a branch based on
uninitialized memory; and depending on compile options, the state
of the stack could result in the test segfaulting.  I missed the
fact that we were previously relying on 'u' being fully
initialized.

Signed-off-by: Eric Blake <eblake@redhat.com>

---
Introduced by my patch still under review, so easiest is to squash
this in rather than supply it as a separate patch.
---
 tests/test-qmp-output-visitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c
index 88e01ea..cfb06bb 100644
--- a/tests/test-qmp-output-visitor.c
+++ b/tests/test-qmp-output-visitor.c
@@ -299,7 +299,8 @@  static void test_visitor_out_struct_errors(TestOutputVisitorData *data,
                                            const void *unused)
 {
     EnumOne bad_values[] = { ENUM_ONE_MAX, -1 };
-    UserDefOne u, *pu = &u;
+    UserDefOne u = {0};
+    UserDefOne *pu = &u;
     Error *err;
     int i;