aboutsummaryrefslogtreecommitdiffstats
path: root/capture_sync.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-01-14 16:34:19 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-01-14 16:34:19 +0000
commitde91f3638b55d1e36dd04bba792cfab2c03de1c1 (patch)
tree541fc7be18a30af3dd2d530cdadd1c426361fb8a /capture_sync.c
parent31e5c6f7273a0963296ef2dc0e2bdcc223773b8d (diff)
Declare count as ssize_t instead of size_t, since read(), and thus ws_read(), can return a negative number. If that were to happen, then assigning the return value to an unsigned variable and then comparing that variable against 0 will yield incorrect/unintended results. Fixes Coverity CID 761910: Negative array index write.
svn path=/trunk/; revision=47069
Diffstat (limited to 'capture_sync.c')
-rw-r--r--capture_sync.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/capture_sync.c b/capture_sync.c
index b0a1bc2464..28631adc4d 100644
--- a/capture_sync.c
+++ b/capture_sync.c
@@ -957,7 +957,7 @@ sync_pipe_run_command(const char** argv, gchar **data, gchar **primary_msg,
char *secondary_msg_text;
char *combined_msg;
GString *data_buf = NULL;
- size_t count;
+ ssize_t count;
ret = sync_pipe_open_command(argv, &data_pipe_read_fd, &sync_pipe_read_fd,
&fork_child, &msg);