[Bugs] [Bug 789278] Issues reported by Coverity static analysis tool

bugzilla at redhat.com bugzilla at redhat.com
Mon Nov 13 16:36:32 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=789278



--- Comment #1183 from Worker Ant <bugzilla-bot at gluster.org> ---
COMMIT: https://review.gluster.org/18728 committed in master by \"Kartik
Burmee\" <kburmee at redhat.com> with a commit message- glusterd:
buffer_size_warning coverity fix

function: glusterd_import_volinfo

problem: Calling strncpy with a maximum size argument of 256 bytes on
destination array "new_volinfo->parent_volname" of size 256 bytes might leave
the destination string unterminated.

fix: The third argument of strncpy specifies the number of characters to be
copied from the source string to the destination string. To make sure that the
final string in destination is always null terminated, we copy 1 less character
than the total capacity of the destination array and the last element of the
array will be filled by '/0' automatically by the strncpy function.

html link of issue:
https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-11-10-0f524f07/html/1/39glusterd-utils.c.html#error

Change-Id: I76b0d10e6a932b0885531c9be3c4f4ce7239f3e1
BUG: 789278
Signed-off-by: Kartik_Burmee <kburmee at redhat.com>

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Bugs mailing list