diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-02-25 12:15:05 -0500 |
---|---|---|
committer | Balint Reczey <balint@balintreczey.hu> | 2014-02-26 11:32:52 +0000 |
commit | 2c0974540699dabe9484fa2ef3fde39fc6b573cf (patch) | |
tree | 9dd78b56c0d85502e75f8306314ad767b6286a71 /capture_sync.c | |
parent | ea1d5c151e0ef5620ca0421ed6d3154afb97ba50 (diff) | |
download | wireshark-2c0974540699dabe9484fa2ef3fde39fc6b573cf.tar.gz |
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>
Diffstat (limited to 'capture_sync.c')
-rw-r--r-- | capture_sync.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/capture_sync.c b/capture_sync.c index 01717e6734..734bf009bb 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -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; |