From d027de5b303edccbad880d7b9494c3f562f1b323 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 28 Aug 2018 16:54:31 -0400 Subject: [PATCH] Fix: use of uninitialized variable in C++ userspace-probe testapp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported-by: Coverity (1395206) Uninitialized scalar variable Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- .../testapp/userspace-probe-elf-cxx-binary/test_class.cpp | 3 +++ .../utils/testapp/userspace-probe-elf-cxx-binary/test_class.h | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.cpp b/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.cpp index 8c25f5145..e673854fe 100644 --- a/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.cpp +++ b/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.cpp @@ -17,6 +17,9 @@ */ #include "test_class.h" +test_class::test_class() { + test_member = 1; +} void test_class::test_method() { test_member += 1; diff --git a/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.h b/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.h index 889792dc5..790a00dcd 100644 --- a/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.h +++ b/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.h @@ -19,6 +19,7 @@ class test_class { public: + test_class(); void test_method(); volatile int test_member; }; -- 2.34.1