[Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS

Lalatendu Mohanty lmohanty at redhat.com
Wed Jun 11 13:40:53 UTC 2014


FYI,

To fix these Coverity issues , please check the below link for guidelines:
http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity

Thanks,
Lala

-------- Original Message --------
Subject: 	New Defects reported by Coverity Scan for GlusterFS
Date: 	Wed, 11 Jun 2014 06:36:17 -0700
From: 	scan-admin at coverity.com



Hi,


Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan.

Defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1222523:  Copy into fixed size buffer  (STRING_OVERFLOW)
/xlators/mgmt/glusterd/src/glusterd-utils.c: 3728 in gd_import_new_brick_snap_details()
/xlators/mgmt/glusterd/src/glusterd-utils.c: 3737 in gd_import_new_brick_snap_details()

** CID 1222524:  Structurally dead code  (UNREACHABLE)
/cli/src/cli-rpc-ops.c: 8796 in gf_cli_snapshot_for_status()


________________________________________________________________________________________________________
*** CID 1222523:  Copy into fixed size buffer  (STRING_OVERFLOW)
/xlators/mgmt/glusterd/src/glusterd-utils.c: 3728 in gd_import_new_brick_snap_details()
3722             snprintf (key, sizeof (key), "%s.device_path", prefix);
3723             ret = dict_get_str (dict, key, &snap_device);
3724             if (ret) {
3725                     gf_log (this->name, GF_LOG_ERROR, "%s missing in payload", key);
3726                     goto out;
3727             }
>>>     CID 1222523:  Copy into fixed size buffer  (STRING_OVERFLOW)
>>>     You might overrun the 4096 byte fixed-size string "brickinfo->device_path" by copying "snap_device" without checking the length.
3728             strcpy (brickinfo->device_path, snap_device);
3729
3730             memset (key, 0, sizeof (key));
3731             snprintf (key, sizeof (key), "%s.mount_dir", prefix);
3732             ret = dict_get_str (dict, key, &mount_dir);
3733             if (ret) {
/xlators/mgmt/glusterd/src/glusterd-utils.c: 3737 in gd_import_new_brick_snap_details()
3731             snprintf (key, sizeof (key), "%s.mount_dir", prefix);
3732             ret = dict_get_str (dict, key, &mount_dir);
3733             if (ret) {
3734                     gf_log (this->name, GF_LOG_ERROR, "%s missing in payload", key);
3735                     goto out;
3736             }
>>>     CID 1222523:  Copy into fixed size buffer  (STRING_OVERFLOW)
>>>     You might overrun the 4096 byte fixed-size string "brickinfo->mount_dir" by copying "mount_dir" without checking the length.
3737             strcpy (brickinfo->mount_dir, mount_dir);
3738
3739     out:
3740             return ret;
3741     }
3742

________________________________________________________________________________________________________
*** CID 1222524:  Structurally dead code  (UNREACHABLE)
/cli/src/cli-rpc-ops.c: 8796 in gf_cli_snapshot_for_status()
8790                             dict_unref (snap_dict);
8791                     }
8792             }
8793     out:
8794             return ret;
8795
>>>     CID 1222524:  Structurally dead code  (UNREACHABLE)
>>>     This code cannot be reached: "if (ret && snap_dict)
   dic...".
8796             if (ret && snap_dict)
8797                     dict_unref (snap_dict);
8798     }
8799
8800     int32_t
8801     gf_cli_snapshot (call_frame_t *frame, xlator_t *this,


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/987?tab=overview

To unsubscribe from the email notification for new defects, http://scan5.coverity.com/cgi-bin/unsubscribe.py





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://supercolony.gluster.org/pipermail/gluster-devel/attachments/20140611/d98c09b3/attachment.html>


More information about the Gluster-devel mailing list