From: Julien Desfossez Date: Tue, 12 Nov 2013 22:41:21 +0000 (-0500) Subject: Fix: unitialized variables in tests X-Git-Tag: v2.4.0-rc1~50 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=dcf5c25ef672792f4a3ec21048f7241dc6afc4b0;p=lttng-tools.git Fix: unitialized variables in tests Some fields in the structures were not set before being sent. It was OK in this context because it was useless parameters, but Coverity complained. Fixes Coverity 1127092 and 1127091 Signed-off-by: Julien Desfossez Signed-off-by: David Goulet --- diff --git a/tests/regression/tools/live/live_test.c b/tests/regression/tools/live/live_test.c index b2935e155..2482e5004 100644 --- a/tests/regression/tools/live/live_test.c +++ b/tests/regression/tools/live/live_test.c @@ -129,6 +129,7 @@ int establish_connection(void) cmd.data_size = sizeof(connect); cmd.cmd_version = 0; + memset(&connect, 0, sizeof(connect)); connect.major = htobe32(VERSION_MAJOR); connect.minor = htobe32(VERSION_MINOR); connect.type = htobe32(VIEWER_CLIENT_COMMAND); @@ -230,6 +231,7 @@ int attach_session(int id) cmd.data_size = sizeof(rq); cmd.cmd_version = 0; + memset(&rq, 0, sizeof(rq)); rq.session_id = htobe64(id); rq.seek = htobe32(VIEWER_SEEK_BEGINNING);