From: Francis Deslauriers Date: Tue, 28 Aug 2018 20:54:31 +0000 (-0400) Subject: Fix: use of uninitialized variable in C++ userspace-probe testapp X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=d027de5b303edccbad880d7b9494c3f562f1b323 Fix: use of uninitialized variable in C++ userspace-probe testapp Reported-by: Coverity (1395206) Uninitialized scalar variable Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- 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; };