mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Fix a few coverity unitinitialzed-value warnings in the unit tests.
Coverity can't see that it is not in fact going to read uninitialized memory here, so we initialize these values unconditionally. Bugfix on 0.4.0.1-alpha.
This commit is contained in:
@@ -44,6 +44,8 @@ test_btrack_launch(void *arg)
|
||||
{
|
||||
orconn_state_msg_t conn;
|
||||
ocirc_chan_msg_t circ;
|
||||
memset(&conn, 0, sizeof(conn));
|
||||
memset(&circ, 0, sizeof(circ));
|
||||
|
||||
(void)arg;
|
||||
conn.gid = 1;
|
||||
@@ -93,6 +95,8 @@ test_btrack_delete(void *arg)
|
||||
{
|
||||
orconn_state_msg_t state;
|
||||
orconn_status_msg_t status;
|
||||
memset(&state, 0, sizeof(state));
|
||||
memset(&status, 0, sizeof(status));
|
||||
|
||||
(void)arg;
|
||||
state.gid = 1;
|
||||
|
||||
@@ -429,6 +429,7 @@ static void
|
||||
test_cntev_orconn_state(void *arg)
|
||||
{
|
||||
orconn_state_msg_t conn;
|
||||
memset(&conn, 0, sizeof(conn));
|
||||
|
||||
(void)arg;
|
||||
MOCK(queue_control_event_string, mock_queue_control_event_string);
|
||||
@@ -468,6 +469,7 @@ static void
|
||||
test_cntev_orconn_state_pt(void *arg)
|
||||
{
|
||||
orconn_state_msg_t conn;
|
||||
memset(&conn, 0, sizeof(conn));
|
||||
|
||||
(void)arg;
|
||||
MOCK(queue_control_event_string, mock_queue_control_event_string);
|
||||
@@ -503,6 +505,7 @@ static void
|
||||
test_cntev_orconn_state_proxy(void *arg)
|
||||
{
|
||||
orconn_state_msg_t conn;
|
||||
memset(&conn, 0, sizeof(conn));
|
||||
|
||||
(void)arg;
|
||||
MOCK(queue_control_event_string, mock_queue_control_event_string);
|
||||
|
||||
Reference in New Issue
Block a user