From bae7b51d628a3ff4d96be1ec62dca1c8ed008dc8 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Thu, 23 Feb 2017 20:17:25 +0100 Subject: Use int instead of int8_t for the 3 variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since strcmp return a int, and since the spec of strcmp do not tell the return value, it could return 256 and this would overflow. Found by Coverity scan. (thanks to Stéphane Marcheusin who explained the details to me) Change-Id: I5195e05b44f8b537226e6cee178d95a1ab904e96 BUG: 789278 Signed-off-by: Michael Scherer Reviewed-on: https://review.gluster.org/16738 Smoke: Gluster Build System Reviewed-by: Shyamsundar Ranganathan Tested-by: Michael Scherer NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra G --- rpc/rpc-lib/src/rpc-transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc') diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c index 33e94450d9c..4fbbc8cd7fc 100644 --- a/rpc/rpc-lib/src/rpc-transport.c +++ b/rpc/rpc-lib/src/rpc-transport.c @@ -171,7 +171,7 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name) char *type = NULL; char str[] = "ERROR"; int32_t ret = -1; - int8_t is_tcp = 0, is_unix = 0, is_ibsdp = 0; + int is_tcp = 0, is_unix = 0, is_ibsdp = 0; volume_opt_list_t *vol_opt = NULL; gf_boolean_t bind_insecure = _gf_false; xlator_t *this = NULL; -- cgit