[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

scan-admin at coverity.com scan-admin at coverity.com
Sat Nov 4 16:34:30 UTC 2017


Hi,

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

2 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
22 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

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


** CID 1382470:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
/xlators/mgmt/glusterd/src/glusterd-geo-rep.c: 3227 in glusterd_op_stage_gsync_create()


________________________________________________________________________________________________________
*** CID 1382470:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
/xlators/mgmt/glusterd/src/glusterd-geo-rep.c: 3227 in glusterd_op_stage_gsync_create()
3221             if (ret) {
3222                     gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
3223                             "Unable to store statefile path");
3224                     goto out;
3225             }
3226     
>>>     CID 1382470:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
>>>     Calling strncpy with a maximum size argument of 4096 bytes on destination array "statefiledir" of size 4096 bytes might leave the destination string unterminated.
3227             strncpy (statefiledir, statefile, sizeof(statefiledir));
3228             statedir = dirname (statefiledir);
3229     
3230             ret = sys_lstat (statedir, &stbuf);
3231             if (!ret && !is_force) {
3232                     snprintf (errmsg, sizeof (errmsg), "Session between %s"

** CID 1382469:    (DEADCODE)
/heal/src/glfs-heal.c: 1749 in main()
/heal/src/glfs-heal.c: 1750 in main()
/heal/src/glfs-heal.c: 1751 in main()
/heal/src/glfs-heal.c: 1752 in main()
/heal/src/glfs-heal.c: 1753 in main()
/heal/src/glfs-heal.c: 1754 in main()
/heal/src/glfs-heal.c: 1755 in main()
/heal/src/glfs-heal.c: 1756 in main()
/heal/src/glfs-heal.c: 1757 in main()
/heal/src/glfs-heal.c: 1758 in main()
/heal/src/glfs-heal.c: 1759 in main()


________________________________________________________________________________________________________
*** CID 1382469:    (DEADCODE)
/heal/src/glfs-heal.c: 1749 in main()
1743                                                        &rootloc, file, heal_op);
1744                             break;
1745             case GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK:
1746                     ret = glfsh_heal_from_brick (fs, top_subvol, &rootloc,
1747                                                  hostname, path, file);
1748                     break;
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_INVALID:".
1749             case GF_SHD_OP_INVALID:
1750             case GF_SHD_OP_HEAL_INDEX:
1751             case GF_SHD_OP_HEAL_FULL:
1752             case GF_SHD_OP_HEALED_FILES:
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
/heal/src/glfs-heal.c: 1750 in main()
1744                             break;
1745             case GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK:
1746                     ret = glfsh_heal_from_brick (fs, top_subvol, &rootloc,
1747                                                  hostname, path, file);
1748                     break;
1749             case GF_SHD_OP_INVALID:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_HEAL_INDEX:".
1750             case GF_SHD_OP_HEAL_INDEX:
1751             case GF_SHD_OP_HEAL_FULL:
1752             case GF_SHD_OP_HEALED_FILES:
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
/heal/src/glfs-heal.c: 1751 in main()
1745             case GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK:
1746                     ret = glfsh_heal_from_brick (fs, top_subvol, &rootloc,
1747                                                  hostname, path, file);
1748                     break;
1749             case GF_SHD_OP_INVALID:
1750             case GF_SHD_OP_HEAL_INDEX:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_HEAL_FULL:".
1751             case GF_SHD_OP_HEAL_FULL:
1752             case GF_SHD_OP_HEALED_FILES:
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
1756             case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
/heal/src/glfs-heal.c: 1752 in main()
1746                     ret = glfsh_heal_from_brick (fs, top_subvol, &rootloc,
1747                                                  hostname, path, file);
1748                     break;
1749             case GF_SHD_OP_INVALID:
1750             case GF_SHD_OP_HEAL_INDEX:
1751             case GF_SHD_OP_HEAL_FULL:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_HEALED_FILES:".
1752             case GF_SHD_OP_HEALED_FILES:
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
1756             case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
1757             case GF_SHD_OP_HEAL_ENABLE:
/heal/src/glfs-heal.c: 1753 in main()
1747                                                  hostname, path, file);
1748                     break;
1749             case GF_SHD_OP_INVALID:
1750             case GF_SHD_OP_HEAL_INDEX:
1751             case GF_SHD_OP_HEAL_FULL:
1752             case GF_SHD_OP_HEALED_FILES:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_HEAL_FAILED_...".
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
1756             case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
1757             case GF_SHD_OP_HEAL_ENABLE:
1758             case GF_SHD_OP_HEAL_DISABLE:
/heal/src/glfs-heal.c: 1754 in main()
1748                     break;
1749             case GF_SHD_OP_INVALID:
1750             case GF_SHD_OP_HEAL_INDEX:
1751             case GF_SHD_OP_HEAL_FULL:
1752             case GF_SHD_OP_HEALED_FILES:
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_STATISTICS:".
1754             case GF_SHD_OP_STATISTICS:
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
1756             case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
1757             case GF_SHD_OP_HEAL_ENABLE:
1758             case GF_SHD_OP_HEAL_DISABLE:
1759             case GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE:
/heal/src/glfs-heal.c: 1755 in main()
1749             case GF_SHD_OP_INVALID:
1750             case GF_SHD_OP_HEAL_INDEX:
1751             case GF_SHD_OP_HEAL_FULL:
1752             case GF_SHD_OP_HEALED_FILES:
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_STATISTICS_H...".
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
1756             case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
1757             case GF_SHD_OP_HEAL_ENABLE:
1758             case GF_SHD_OP_HEAL_DISABLE:
1759             case GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE:
1760                     ret = -EINVAL;
/heal/src/glfs-heal.c: 1756 in main()
1750             case GF_SHD_OP_HEAL_INDEX:
1751             case GF_SHD_OP_HEAL_FULL:
1752             case GF_SHD_OP_HEALED_FILES:
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_STATISTICS_H...".
1756             case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
1757             case GF_SHD_OP_HEAL_ENABLE:
1758             case GF_SHD_OP_HEAL_DISABLE:
1759             case GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE:
1760                     ret = -EINVAL;
1761                     break;
/heal/src/glfs-heal.c: 1757 in main()
1751             case GF_SHD_OP_HEAL_FULL:
1752             case GF_SHD_OP_HEALED_FILES:
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
1756             case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_HEAL_ENABLE:".
1757             case GF_SHD_OP_HEAL_ENABLE:
1758             case GF_SHD_OP_HEAL_DISABLE:
1759             case GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE:
1760                     ret = -EINVAL;
1761                     break;
1762             }
/heal/src/glfs-heal.c: 1758 in main()
1752             case GF_SHD_OP_HEALED_FILES:
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
1756             case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
1757             case GF_SHD_OP_HEAL_ENABLE:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_HEAL_DISABLE:".
1758             case GF_SHD_OP_HEAL_DISABLE:
1759             case GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE:
1760                     ret = -EINVAL;
1761                     break;
1762             }
1763     
/heal/src/glfs-heal.c: 1759 in main()
1753             case GF_SHD_OP_HEAL_FAILED_FILES:
1754             case GF_SHD_OP_STATISTICS:
1755             case GF_SHD_OP_STATISTICS_HEAL_COUNT:
1756             case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
1757             case GF_SHD_OP_HEAL_ENABLE:
1758             case GF_SHD_OP_HEAL_DISABLE:
>>>     CID 1382469:    (DEADCODE)
>>>     Execution cannot reach this statement: "case GF_SHD_OP_GRANULAR_ENT...".
1759             case GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE:
1760                     ret = -EINVAL;
1761                     break;
1762             }
1763     
1764             glfsh_output->end (ret, NULL);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZBK54bFWohdObZ6wlkeK264nDC24cnLwH4MTOSDXRjQcO27-2F6DmQXPB4g4Mz-2BEJJ0-3D_pIB5qNyu3krz5eLOmjwFZkKK-2FJ3CPgtiU1pdCCu-2BphdokdXKV3dj-2BwRLX-2BbNrO-2FgxEox5ySxXvt6Cw2yRH-2FMJOxJUzzpm2DIArT3ehUWnruiLgZdxdTw-2FUnmUe8DS5-2FkXE00VpaymlTtoZB9fwdIn2RXdnl01EziBHDZRxse9x3MTGsvN1MFsmMlCMJJDogSlLw3aegZMvZKg1bDsDgK5-2FJkJ0aQhmKXs6bdrF92Wfw-3D

To manage Coverity Scan email notifications for "gluster-devel at gluster.org", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq48r9wNv8-2BLR0R-2BBlXm7ottYIbnE5UU-2F0Z00EseY5i5N2c1DtvQJ8Cp-2BSp5bYUPGR1MbiG-2F6KsJiGF2zIdiuCrkCwl5z0BqidHVuHFKKiyVZo-3D_pIB5qNyu3krz5eLOmjwFZkKK-2FJ3CPgtiU1pdCCu-2BphdokdXKV3dj-2BwRLX-2BbNrO-2FgxEox5ySxXvt6Cw2yRH-2FMJNKD9PHMCWETnU7KzKBg9p6GaKaGguBv-2Bi8RlwCvos1pDCkppLmo2atRX-2BkFRQV-2BzByM-2F-2B7s4SSu5pJhyTF0qWhcVtSJjT-2FjXRNQsyK0YbwJ5CRLF-2B5w6g224DpFIfi7dkotezGas7RYwdubkJh1PYI-3D



More information about the Gluster-devel mailing list