qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v9 05.5/17] fixup to qapi: Unbox base members


From: Eric Blake
Subject: [Qemu-devel] [PATCH v9 05.5/17] fixup to qapi: Unbox base members
Date: Fri, 16 Oct 2015 13:12:43 -0600

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 <address@hidden>

---
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 --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;

-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]