Bug 1352281 - Issues reported by Coverity static analysis tool
Summary: Issues reported by Coverity static analysis tool
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: build
Version: 3.8.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On: 789278
Blocks: 1215026
TreeView+ depends on / blocked
 
Reported: 2016-07-03 10:37 UTC by Atin Mukherjee
Modified: 2017-10-25 12:41 UTC (History)
7 users (show)

Fixed In Version: glusterfs-3.8.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 789278
Environment:
Last Closed: 2016-07-08 14:42:55 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Atin Mukherjee 2016-07-03 10:37:54 UTC
this is an umbrella bug for all the coverity fixes for 3.8 branch

Comment 1 Vijay Bellur 2016-07-03 10:38:56 UTC
REVIEW: http://review.gluster.org/14850 (glusterd/cli: coverity fixes) posted (#1) for review on release-3.8 by Atin Mukherjee (amukherj)

Comment 2 Vijay Bellur 2016-07-04 10:19:59 UTC
COMMIT: http://review.gluster.org/14850 committed in release-3.8 by Atin Mukherjee (amukherj) 
------
commit 021813ca53762f09cb9f43d740a6aaab5659aa51
Author: Atin Mukherjee <amukherj>
Date:   Tue Jun 28 15:32:17 2016 +0530

    glusterd/cli: coverity fixes
    
    Backport of http://review.gluster.org/#/c/14818/
    
    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: 1352281
    Signed-off-by: Atin Mukherjee <amukherj>
    Reviewed-on: http://review.gluster.org/14818
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Jeff Darcy <jdarcy>
    Reviewed-on: http://review.gluster.org/14850
    Reviewed-by: Prashanth Pai <ppai>

Comment 3 Niels de Vos 2016-07-08 14:42:55 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.8.1, please open a new bug report.

glusterfs-3.8.1 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.packaging/156
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 4 Worker Ant 2017-10-25 12:41:36 UTC
REVIEW: https://review.gluster.org/18574 (Make sure attach_brick return a proper error code) posted (#1) for review on master by Michael Scherer (misc)


Note You need to log in before you can comment on or make changes to this bug.