smartmontools-7.5-8.fc45

List of Findings

Error: SHELLCHECK_WARNING (CWE-563): [#def1]
/etc/smartmontools/smartd_warning.sh:21:1: warning[SC2034]: prefix appears unused. Verify use (or export if used externally).
#   19|   PACKAGE="smartmontools"
#   20|   VERSION="7.5"
#   21|-> prefix="/usr"
#   22|   sysconfdir="/etc/smartmontools"
#   23|   smartdscriptdir="${sysconfdir}"

Error: SHELLCHECK_WARNING (CWE-563): [#def2]
/usr/bin/update-smart-drivedb:21:1: warning[SC2034]: exec_prefix appears unused. Verify use (or export if used externally).
#   19|   VERSION="7.5"
#   20|   prefix="/usr"
#   21|-> exec_prefix="/usr"
#   22|   sbindir="/usr/bin"
#   23|   datarootdir="${prefix}/share"

Error: SHELLCHECK_WARNING (CWE-563): [#def3]
/usr/bin/update-smart-drivedb:23:1: warning[SC2034]: datarootdir appears unused. Verify use (or export if used externally).
#   21|   exec_prefix="/usr"
#   22|   sbindir="/usr/bin"
#   23|-> datarootdir="${prefix}/share"
#   24|   datadir="/usr/share"
#   25|   localstatedir="/var"

Error: SHELLCHECK_WARNING (CWE-563): [#def4]
/usr/bin/update-smart-drivedb:25:1: warning[SC2034]: localstatedir appears unused. Verify use (or export if used externally).
#   23|   datarootdir="${prefix}/share"
#   24|   datadir="/usr/share"
#   25|-> localstatedir="/var"
#   26|   drivedbinstdir="${datadir}/${PACKAGE}"
#   27|   drivedbdir="${datadir}/${PACKAGE}"

Error: SHELLCHECK_WARNING: [#def5]
/usr/bin/update-smart-drivedb:144:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  142|   inpath()
#  143|   {
#  144|->   local d rc save
#  145|     rc=1
#  146|     save=$IFS

Error: SHELLCHECK_WARNING: [#def6]
/usr/bin/update-smart-drivedb:184:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  182|   vrun2()
#  183|   {
#  184|->   local f err rc
#  185|     f=$1; shift
#  186|     rc=0

Error: SHELLCHECK_WARNING: [#def7]
/usr/bin/update-smart-drivedb:203:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  201|   download()
#  202|   {
#  203|->   local f u rc
#  204|     u=$1; f=$2
#  205|     rc=0

Error: SHELLCHECK_WARNING: [#def8]
/usr/bin/update-smart-drivedb:267:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  265|   check_file()
#  266|   {
#  267|->   local firstchar f maxsize minsize size
#  268|     f=$1; firstchar=$2; minsize=$3; maxsize=$4
#  269|   

Error: SHELLCHECK_WARNING: [#def9]
/usr/bin/update-smart-drivedb:498:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  496|   gpg_verify()
#  497|   {
#  498|->   local gnupgtmp i out rc
#  499|   
#  500|     # Create temp home dir

Error: SHELLCHECK_WARNING: [#def10]
/usr/bin/update-smart-drivedb:545:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  543|   get_db_version()
#  544|   {
#  545|->   local r v x
#  546|     x=`sed -n '/^[ {]*"VERSION: *[^"]*"/{
#  547|          s,^[ {]*"VERSION: \([1-9][./0-9]* [^"]*\)".*$,\1,p

Error: CPPCHECK_WARNING (CWE-476): [#def11]
smartmontools-7.5/atacmds.cpp:2728: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 2726|             break;
# 2727|           for (unsigned k = 0; k < 16; k++)
# 2728|->           data[j*16+k] = b[k];
# 2729|           line = nextline(line, lineno);
# 2730|         }

Error: CPPCHECK_WARNING (CWE-758): [#def12]
smartmontools-7.5/dev_jmb39x_raid.cpp:134: error[ctuPointerArith]: Pointer arithmetic overflow; 'data' buffer size is 512
#  132|   static inline uint32_t jmb_get_crc(const uint8_t (& data)[512])
#  133|   {
#  134|->   return sg_get_unaligned_le32(data + sizeof(data) - 4);
#  135|   }
#  136|   

Error: CPPCHECK_WARNING (CWE-758): [#def13]
smartmontools-7.5/dev_jmb39x_raid.cpp:139: error[ctuPointerArith]: Pointer arithmetic overflow; 'data' buffer size is 512
#  137|   static inline void jmb_put_crc(uint8_t (& data)[512], uint32_t crc)
#  138|   {
#  139|->   sg_put_unaligned_le32(crc, data + sizeof(data) - 4);
#  140|   }
#  141|   

Error: COMPILER_WARNING (CWE-477): [#def14]
smartmontools-7.5/os_linux.cpp: scope_hint: In function ‘int os_linux::setup_3ware_nodes(const char*, const char*)’
smartmontools-7.5/os_linux.cpp:1613:22: warning[-Wdeprecated-declarations]: ‘security_context_t’ is deprecated
# 1613 |   security_context_t orig_context = NULL;
#      |                      ^~~~~~~~~~~~
smartmontools-7.5/os_linux.cpp:67: included_from: Included from here.
/usr/include/selinux/selinux.h:19:15: note: declared here
#   19 | typedef char *security_context_t
#      |               ^~~~~~~~~~~~~~~~~~
# 1611|     int              retval = 0;
# 1612|   #ifdef HAVE_LIBSELINUX
# 1613|->   security_context_t orig_context = NULL;
# 1614|     security_context_t node_context = NULL;
# 1615|     int                selinux_enabled  = is_selinux_enabled();

Error: COMPILER_WARNING (CWE-477): [#def15]
smartmontools-7.5/os_linux.cpp:1614:22: warning[-Wdeprecated-declarations]: ‘security_context_t’ is deprecated
# 1614 |   security_context_t node_context = NULL;
#      |                      ^~~~~~~~~~~~
/usr/include/selinux/selinux.h:19:15: note: declared here
#   19 | typedef char *security_context_t
#      |               ^~~~~~~~~~~~~~~~~~
# 1612|   #ifdef HAVE_LIBSELINUX
# 1613|     security_context_t orig_context = NULL;
# 1614|->   security_context_t node_context = NULL;
# 1615|     int                selinux_enabled  = is_selinux_enabled();
# 1616|     int                selinux_enforced = security_getenforce();

Error: COMPILER_WARNING (CWE-477): [#def16]
smartmontools-7.5/os_linux.cpp:1651:26: warning[-Wdeprecated-declarations]: ‘void matchpathcon_fini()’ is deprecated: Use selabel_close
# 1651 |         matchpathcon_fini();
#      |         ~~~~~~~~~~~~~~~~~^~
/usr/include/selinux/selinux.h:479:13: note: declared here
#  479 | extern void matchpathcon_fini(void)
#      |             ^~~~~~~~~~~~~~~~~
# 1649|         pout("Error retrieving original SELinux fscreate context");
# 1650|         if (selinux_enforced) {
# 1651|->         matchpathcon_fini();
# 1652|           return 6;
# 1653|         }

Error: COMPILER_WARNING (CWE-477): [#def17]
smartmontools-7.5/os_linux.cpp:1663:23: warning[-Wdeprecated-declarations]: ‘int matchpathcon(const char*, mode_t, char**)’ is deprecated: Use selabel_lookup instead
# 1663 |       if (matchpathcon(nodestring, S_IRUSR | S_IWUSR, &node_context) < 0) {
#      |           ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/selinux/selinux.h:496:12: note: declared here
#  496 | extern int matchpathcon(const char *path, mode_t mode, char **con)
#      |            ^~~~~~~~~~~~
# 1661|       /* Get context of the node and set it as the default */
# 1662|       if (selinux_enabled) {
# 1663|->       if (matchpathcon(nodestring, S_IRUSR | S_IWUSR, &node_context) < 0) {
# 1664|           pout("Could not retrieve context for %s", nodestring);
# 1665|           if (selinux_enforced) {

Error: COMPILER_WARNING (CWE-477): [#def18]
smartmontools-7.5/os_linux.cpp:1740:22: warning[-Wdeprecated-declarations]: ‘void matchpathcon_fini()’ is deprecated: Use selabel_close
# 1740 |     matchpathcon_fini();
#      |     ~~~~~~~~~~~~~~~~~^~
/usr/include/selinux/selinux.h:479:13: note: declared here
#  479 | extern void matchpathcon_fini(void)
#      |             ^~~~~~~~~~~~~~~~~
# 1738|       if(node_context)
# 1739|         freecon(node_context);
# 1740|->     matchpathcon_fini();
# 1741|     }
# 1742|   #endif

Error: COMPILER_WARNING: [#def19]
smartmontools-7.5/scsiprint.cpp: scope_hint: In function ‘int scsiPrintActiveTapeAlerts(scsi_device*, int, bool)’
smartmontools-7.5/scsiprint.cpp:435:12: warning[-Wunused-but-set-variable=]: variable ‘k’ set but not used
#  435 |     int i, k, j, m, err;
#      |            ^
#  433|       unsigned short pagelength;
#  434|       unsigned short parametercode;
#  435|->     int i, k, j, m, err;
#  436|       const char *s;
#  437|       const char *ts;

Error: COMPILER_WARNING (CWE-252): [#def20]
smartmontools-7.5/smartd.cpp: scope_hint: In function ‘void capabilities_drop_now()’
smartmontools-7.5/smartd.cpp:1059:14: warning[-Wunused-result]: ignoring return value of ‘int capng_apply(capng_select_t)’ declared with attribute ‘warn_unused_result’
# 1059 |   capng_apply(CAPNG_SELECT_BOTH);
#      |   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
# 1057|         CAP_SETGID, CAP_SETUID, CAP_CHOWN, CAP_FOWNER, CAP_DAC_OVERRIDE, -1);
# 1058|     }
# 1059|->   capng_apply(CAPNG_SELECT_BOTH);
# 1060|   }
# 1061|   

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-16.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namesmartmontools-7.5-8.fc45
store-results-to/tmp/tmp9xb94kwt/smartmontools-7.5-8.fc45.tar.xz
time-created2026-08-03 20:56:55
time-finished2026-08-03 20:58:22
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmp9xb94kwt/smartmontools-7.5-8.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp9xb94kwt/smartmontools-7.5-8.fc45.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9