diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2016-06-28 15:32:17 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-06-28 13:30:55 -0700 |
commit | c2d3703ed70d13063d693f135d89538db526ad5c (patch) | |
tree | cd28a2b0f8d622693adb74c9a0bf167a18ce6c45 /xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | |
parent | e5221d288e41d29d89d52f8deab657d2285a852c (diff) |
glusterd/cli: coverity fixes
A downstream coverity run has revealed few of the following coverity defects.
Since the downstream code is a clone of a specific upstream branch the defects
hold true for the upstream as well.
Defect type: NEGATIVE_RETURNS
xlators/mgmt/glusterd/src/glusterd-rpc-ops.c:641: negative_returns: "op_errno"
is passed to a parameter that cannot be negative.
Defect type: BUFFER_SIZE_WARNING
xlators/mgmt/glusterd/src/glusterd-volume-ops.c:2124: buffer_size_warning:
Calling strncpy with a maximum size argument of 261 bytes on destination array
"volinfo->volname" of size 261 bytes might leave the destination string
unterminated.
Defect type: BUFFER_SIZE_WARNING
xlators/mgmt/glusterd/src/glusterd-volgen.c:4888: buffer_size_warning: Calling
strncpy with a maximum size argument of 261 bytes on destination array
"volinfo->volname" of size 261 bytes might leave the destination string
unterminated.
Defect type: STRING_OVERFLOW
xlators/mgmt/glusterd/src/glusterd-volgen.c:3449: string_overflow: You might
overrun the 256 byte destination string "tmp_volname" by writing 261 bytes from
"volinfo->volname".
Defect type: BUFFER_SIZE_WARNING
xlators/mgmt/glusterd/src/glusterd-utils.c:3392: buffer_size_warning: Calling
strncpy with a maximum size argument of 261 bytes on destination array
"new_volinfo->volname" of size 261 bytes might leave the destination string
unterminated.
Defect type: NO_EFFECT
xlators/mgmt/glusterd/src/glusterd-utils.c:7359: remediation: Was
"rebal->rebalance_id" formerly declared as a pointer?
Defect type: USE_AFTER_FREE
xlators/mgmt/glusterd/src/glusterd-utils.c:7115: pass_freed_arg: Passing freed
pointer "volinfo" as an argument to "glusterd_friend_contains_vol_bricks".
Defect type: DEADCODE
cli/src/cli-cmd-parser.c:1767: dead_error_begin: Execution cannot reach this
statement: "ret = -1;".
Change-Id: Ie941bdf31923e2f39618dd94bfae16fdb3ad65f1
BUG: 789278
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/14818
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rpc-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index f7e8cfe248c..73646ec4bfc 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -559,7 +559,7 @@ __glusterd_friend_remove_cbk (struct rpc_req * req, struct iovec *iov, glusterd_friend_sm_event_type_t event_type = GD_FRIEND_EVENT_NONE; glusterd_peerinfo_t *peerinfo = NULL; int32_t op_ret = -1; - int32_t op_errno = -1; + int32_t op_errno = 0; glusterd_probe_ctx_t *ctx = NULL; gf_boolean_t move_sm_now = _gf_true; |