Fix capture_sync: Assigned value is garbage or undefined (clang analyzer)

I'm not 100% positive this fix is the right way to handle this condition,
but it seems the safest way without changing a lot of other code.

Change-Id: Icaa8d6f38bc03177162f046d1e7ca55d87bad6a6
Reviewed-on: https://code.wireshark.org/review/373
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Tested-by: Balint Reczey <balint@balintreczey.hu>
This commit is contained in:
Hadriel Kaplan 2014-02-25 12:15:05 -05:00 committed by Balint Reczey
parent ea1d5c151e
commit 2c09745406
1 changed files with 3 additions and 3 deletions

View File

@ -981,7 +981,7 @@ sync_pipe_run_command_actual(char** argv, gchar **data, gchar **primary_msg,
gchar *msg;
int data_pipe_read_fd, sync_pipe_read_fd, fork_child, ret;
char *wait_msg;
gchar buffer[PIPE_BUF_SIZE+1];
gchar buffer[PIPE_BUF_SIZE+1] = {0};
ssize_t nread;
char indicator;
int primary_msg_len;
@ -1331,7 +1331,7 @@ sync_interface_stats_open(int *data_read_fd, int *fork_child, gchar **msg, void
char **argv;
int message_read_fd, ret;
char *wait_msg;
gchar buffer[PIPE_BUF_SIZE+1];
gchar buffer[PIPE_BUF_SIZE+1] = {0};
ssize_t nread;
char indicator;
int primary_msg_len;
@ -1691,7 +1691,7 @@ sync_pipe_input_cb(gint source, gpointer user_data)
{
capture_session *cap_session = (capture_session *)user_data;
int ret;
char buffer[SP_MAX_MSG_LEN+1];
char buffer[SP_MAX_MSG_LEN+1] = {0};
ssize_t nread;
char indicator;
int primary_len;