Error: SHELLCHECK_WARNING (CWE-571): [#def1] /usr/bin/raid-check:23:12: warning[SC2155]: Declare and assign separately to avoid masking return values. # 21| local dev="" # 22| for dev in $dev_list; do # 23|-> local sync_action=`cat /sys/block/$dev/md/sync_action` # 24| if [ "$sync_action" != "idle" ]; then # 25| let busy++ Error: SHELLCHECK_WARNING (CWE-477): [#def2] /usr/bin/raid-check:73:33: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 71| # when two or more arrays are on the same physical disk # 72| array_state=`cat /sys/block/$dev/md/array_state` # 73|-> if [ "$array_state" != "clean" -a "$array_state" != "active" ]; then # 74| continue # 75| fi Error: SHELLCHECK_WARNING (CWE-477): [#def3] /usr/bin/raid-check:100:25: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 98| resync_pid="" # 99| wait=10 # 100|-> while [ $wait -gt 0 -a -z "$resync_pid" ]; do # 101| sleep 6 # 102| let wait-- Error: SHELLCHECK_WARNING (CWE-477): [#def4] /usr/bin/raid-check:105:24: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 103| resync_pid=$(ps -ef | awk -v mddev=$dev 'BEGIN { pattern = "^\\[" mddev "_resync]$" } $8 ~ pattern { print $2 }') # 104| done # 105|-> [ -n "$resync_pid" -a -n "$renice" ] && # 106| renice $renice -p $resync_pid >&/dev/null # 107| [ -n "$resync_pid" -a -n "$ionice" ] && Error: SHELLCHECK_WARNING (CWE-477): [#def5] /usr/bin/raid-check:107:24: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 105| [ -n "$resync_pid" -a -n "$renice" ] && # 106| renice $renice -p $resync_pid >&/dev/null # 107|-> [ -n "$resync_pid" -a -n "$ionice" ] && # 108| ionice $ionice -p $resync_pid >&/dev/null # 109| done Error: SHELLCHECK_WARNING (CWE-477): [#def6] /usr/bin/raid-check:128:29: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 126| # be in the device. # 127| raid_lvl=`cat /sys/block/$dev/md/level` # 128|-> if [ "$raid_lvl" = "raid1" -o "$raid_lvl" = "raid10" ]; then # 129| continue # 130| fi Error: SHELLCHECK_WARNING (CWE-156): [#def7] /usr/share/mdadm/mdcheck:36:6: warning[SC2046]: Quote this to prevent word splitting. # 34| # convert a /dev/md name into /sys/.../md equivalent # 35| sysname() { # 36|-> set `ls -lLd $1` # 37| maj=${5%,} # 38| min=$6 Error: SHELLCHECK_WARNING (CWE-477): [#def8] /usr/share/mdadm/mdcheck:98:23: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 96| start=0 # 97| logger -p daemon.info mdcheck start checking $dev # 98|-> elif [ -z "$MD_UUID" -o ! -f "$fl" ] # 99| then # 100| # Nothing to continue here Error: SHELLCHECK_WARNING (CWE-156): [#def9] /usr/share/mdadm/mdcheck:121:9: warning[SC2046]: Quote this to prevent word splitting. # 119| fi # 120| # 121|-> while [ `date +%s` -lt $endtime ] # 122| do # 123| any= Error: SHELLCHECK_WARNING (CWE-156): [#def10] /usr/share/mdadm/mdcheck:165:47: warning[SC2046]: Quote this to prevent word splitting. # 163| echo idle > $sys/md/sync_action # 164| cat $sys/md/sync_min > $fl # 165|-> logger -p daemon.info pause checking $dev at `cat $fl` # 166| done Error: GCC_ANALYZER_WARNING (CWE-688): [#def11] mdadm-4.3/Dump.c:244:17: warning[-Wanalyzer-null-argument]: use of NULL ‘opendir(dir)’ where non-null expected mdadm-4.3/Dump.c:176:12: branch_false: following ‘false’ branch... mdadm-4.3/Dump.c:180:30: branch_false: ...to here mdadm-4.3/Dump.c:186:12: branch_false: following ‘false’ branch... mdadm-4.3/Dump.c:191:14: branch_false: ...to here mdadm-4.3/Dump.c:191:12: branch_false: following ‘false’ branch... mdadm-4.3/Dump.c:196:23: branch_false: ...to here mdadm-4.3/Dump.c:196:12: branch_true: following ‘true’ branch... mdadm-4.3/Dump.c:198:26: branch_true: ...to here mdadm-4.3/Dump.c:198:26: acquire_memory: allocated here mdadm-4.3/Dump.c:205:24: release_memory: assuming ‘opendir(dir)’ is NULL mdadm-4.3/Dump.c:205:24: branch_false: following ‘false’ branch... mdadm-4.3/Dump.c:244:17: branch_false: ...to here mdadm-4.3/Dump.c:244:17: danger: argument 1 (‘opendir(dir)’) NULL where non-null expected # 242| return 1; # 243| } # 244|-> closedir(d); # 245| if (!chosen) { # 246| /* One last chance: try basename of device */ Error: GCC_ANALYZER_WARNING (CWE-465): [#def12] mdadm-4.3/Incremental.c:144:15: warning[-Wanalyzer-deref-before-check]: check of ‘devlist’ for NULL after already dereferencing it mdadm-4.3/Incremental.c:110:12: branch_false: following ‘false’ branch... mdadm-4.3/Incremental.c:112:15: branch_false: ...to here mdadm-4.3/Incremental.c:113:12: branch_false: following ‘false’ branch... mdadm-4.3/Incremental.c:120:13: branch_false: ...to here mdadm-4.3/Incremental.c:120:12: branch_false: following ‘false’ branch... branch_false: ...to here mdadm-4.3/Incremental.c:144:15: danger: pointer ‘devlist’ is checked for NULL here but it was already dereferenced at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 142| /* 1/ Check if device is permitted by mdadm.conf */ # 143| # 144|-> for (;devlist; devlist = devlist->next) # 145| if (conf_test_dev(devlist->devname)) # 146| break; Error: GCC_ANALYZER_WARNING (CWE-476): [#def13] mdadm-4.3/Monitor.c:998:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sl’ mdadm-4.3/Monitor.c:949:12: enter_function: entry to ‘add_new_arrays’ mdadm-4.3/Monitor.c:955:28: branch_true: following ‘true’ branch (when ‘mse’ is non-NULL)... mdadm-4.3/Monitor.c:956:21: branch_true: ...to here mdadm-4.3/Monitor.c:956:20: branch_true: following ‘true’ branch... mdadm-4.3/Monitor.c:956:40: branch_true: ...to here mdadm-4.3/Monitor.c:964:28: branch_false: following ‘false’ branch... mdadm-4.3/Monitor.c:969:34: branch_false: ...to here mdadm-4.3/Monitor.c:970:28: branch_false: following ‘false’ branch... mdadm-4.3/Monitor.c:971:29: branch_false: ...to here mdadm-4.3/Monitor.c:970:29: branch_false: following ‘false’ branch... mdadm-4.3/Monitor.c:983:25: branch_false: ...to here mdadm-4.3/Monitor.c:990:28: branch_true: following ‘true’ branch... mdadm-4.3/Monitor.c:991:29: branch_true: ...to here mdadm-4.3/Monitor.c:990:29: branch_true: following ‘true’ branch... mdadm-4.3/Monitor.c:993:29: call_function: inlined call to ‘is_subarray’ from ‘add_new_arrays’ mdadm-4.3/Monitor.c:990:29: branch_true: following ‘true’ branch... mdadm-4.3/Monitor.c:995:33: branch_true: ...to here mdadm-4.3/Monitor.c:998:33: danger: dereference of NULL ‘sl’ # 996| "%s", mse->metadata_version + 10); # 997| sl = strchr(st->parent_devnm, '/'); # 998|-> *sl = 0; # 999| } else # 1000| st->parent_devnm[0] = 0; Error: GCC_ANALYZER_WARNING (CWE-775): [#def14] mdadm-4.3/mdadm.c:1060:30: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(optarg, 2)’ mdadm-4.3/mdadm.c:110:12: branch_false: following ‘false’ branch... mdadm-4.3/mdadm.c:115:9: branch_false: ...to here mdadm-4.3/mdadm.c:117:16: branch_true: following ‘true’ branch (when ‘opt != -1’)... mdadm-4.3/mdadm.c:122:17: branch_true: ...to here mdadm-4.3/mdadm.c:261:20: branch_false: following ‘false’ branch... mdadm-4.3/mdadm.c:263:36: branch_false: ...to here mdadm-4.3/mdadm.c:263:27: branch_false: following ‘false’ branch... mdadm-4.3/mdadm.c:274:28: branch_false: ...to here mdadm-4.3/mdadm.c:274:27: branch_true: following ‘true’ branch... mdadm-4.3/mdadm.c:276:29: branch_true: ...to here mdadm-4.3/mdadm.c:276:28: branch_false: following ‘false’ branch... mdadm-4.3/mdadm.c:321:17: branch_false: ...to here mdadm-4.3/mdadm.c:333:20: branch_false: following ‘false’ branch (when ‘opt != 1’)... mdadm-4.3/mdadm.c:368:25: branch_false: ...to here mdadm-4.3/mdadm.c:1049:28: branch_false: following ‘false’ branch... mdadm-4.3/mdadm.c:1053:29: branch_false: ...to here mdadm-4.3/mdadm.c:1053:28: branch_false: following ‘false’ branch (when the strings are non-equal)... mdadm-4.3/mdadm.c:1054:29: branch_false: ...to here mdadm-4.3/mdadm.c:1053:29: branch_false: following ‘false’ branch (when the strings are non-equal)... mdadm-4.3/mdadm.c:1059:37: branch_false: ...to here mdadm-4.3/mdadm.c:1059:37: acquire_resource: opened here mdadm-4.3/mdadm.c:1060:30: danger: ‘open(optarg, 2)’ leaks here; was opened at [(27)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/26) # 1058| } # 1059| bitmap_fd = open(optarg, O_RDWR); # 1060|-> if (!*optarg || bitmap_fd < 0) { # 1061| pr_err("cannot open bitmap file %s: %s\n", optarg, strerror(errno)); # 1062| exit(2); Error: GCC_ANALYZER_WARNING (CWE-775): [#def15] mdadm-4.3/mdmon.c:446:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[0]’ mdadm-4.3/mdmon.c:444:12: branch_false: following ‘false’ branch... mdadm-4.3/mdmon.c:450:12: branch_false: ...to here mdadm-4.3/mdmon.c:450:12: branch_true: following ‘true’ branch (when ‘must_fork != 0’)... mdadm-4.3/mdmon.c:451:21: branch_true: ...to here mdadm-4.3/mdmon.c:451:20: branch_false: following ‘false’ branch... mdadm-4.3/mdmon.c:455:24: branch_false: ...to here mdadm-4.3/mdmon.c:446:24: danger: ‘pfd[0]’ leaks here # 444| if (mdfd < 0) { # 445| pr_err("%s: %s\n", devnm, strerror(errno)); # 446|-> return 1; # 447| } # 448| Error: GCC_ANALYZER_WARNING (CWE-775): [#def16] mdadm-4.3/mdmon.c:446:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[1]’ mdadm-4.3/mdmon.c:444:12: branch_false: following ‘false’ branch... mdadm-4.3/mdmon.c:450:12: branch_false: ...to here mdadm-4.3/mdmon.c:450:12: branch_true: following ‘true’ branch (when ‘must_fork != 0’)... mdadm-4.3/mdmon.c:451:21: branch_true: ...to here mdadm-4.3/mdmon.c:451:20: branch_false: following ‘false’ branch... mdadm-4.3/mdmon.c:455:24: branch_false: ...to here mdadm-4.3/mdmon.c:446:24: danger: ‘pfd[1]’ leaks here # 444| if (mdfd < 0) { # 445| pr_err("%s: %s\n", devnm, strerror(errno)); # 446|-> return 1; # 447| } # 448| Error: GCC_ANALYZER_WARNING (CWE-775): [#def17] mdadm-4.3/mdmon.c:446:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pfd[status]’ mdadm-4.3/mdmon.c:302:5: enter_function: entry to ‘main’ mdadm-4.3/mdmon.c:370:12: branch_true: following ‘true’ branch... mdadm-4.3/mdmon.c:377:20: branch_false: following ‘false’ branch... mdadm-4.3/mdmon.c:381:39: branch_false: ...to here mdadm-4.3/mdmon.c:381:13: branch_false: following ‘false’ branch... mdadm-4.3/mdmon.c:384:13: branch_false: ...to here mdadm-4.3/mdmon.c:387:12: branch_false: following ‘false’ branch (when ‘help == 0’)... mdadm-4.3/mdmon.c:390:12: branch_false: ...to here mdadm-4.3/mdmon.c:390:12: branch_true: following ‘true’ branch (when ‘all != 0’)... mdadm-4.3/mdmon.c:392:37: branch_true: ...to here mdadm-4.3/mdmon.c:396:34: branch_true: following ‘true’ branch (when ‘e’ is non-NULL)... mdadm-4.3/mdmon.c:397:29: branch_true: ...to here mdadm-4.3/mdmon.c:397:28: branch_true: following ‘true’ branch... mdadm-4.3/mdmon.c:398:29: branch_true: ...to here mdadm-4.3/mdmon.c:397:29: branch_true: following ‘true’ branch... mdadm-4.3/mdmon.c:399:30: call_function: inlined call to ‘is_subarray’ from ‘main’ mdadm-4.3/mdmon.c:397:29: branch_false: following ‘false’ branch... mdadm-4.3/mdmon.c:403:44: branch_false: ...to here mdadm-4.3/mdmon.c:407:43: call_function: calling ‘mdmon’ from ‘main’ # 444| if (mdfd < 0) { # 445| pr_err("%s: %s\n", devnm, strerror(errno)); # 446|-> return 1; # 447| } # 448| Error: CPPCHECK_WARNING (CWE-758): [#def18] mdadm-4.3/platform-intel.c:460: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 458| .vphba = IMSM_OROM_VOLUMES_PER_HBA # 459| }; # 460|-> orom.attr = orom.rlc | IMSM_OROM_ATTR_ChecksumVerify; # 461| # 462| if (check_env("IMSM_TEST_OROM_NORAID5")) { Error: COMPILER_WARNING: [#def19] mdadm-4.3/platform-intel.c:20: included_from: Included from here. mdadm-4.3/platform-intel.c: scope_hint: In function ‘imsm_platform_test’ mdadm-4.3/platform-intel.h:28:37: warning[-Wunterminated-string-initialization]: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (5 chars into 4 available) # 28 | #define IMSM_OROM_SIGNATURE "$VER" # | ^~~~~~ mdadm-4.3/platform-intel.c:447:30: note: in expansion of macro ‘IMSM_OROM_SIGNATURE’ # 447 | .signature = IMSM_OROM_SIGNATURE, # | ^~~~~~~~~~~~~~~~~~~ # 26| struct imsm_orom { # 27| __u8 signature[4]; # 28|-> #define IMSM_OROM_SIGNATURE "$VER" # 29| #define IMSM_NVME_OROM_COMPAT_SIGNATURE "$NVM" # 30| #define IMSM_VMD_OROM_COMPAT_SIGNATURE "$VMD" Error: COMPILER_WARNING: [#def20] mdadm-4.3/platform-intel.c: scope_hint: In function ‘find_imsm_nvme’ mdadm-4.3/platform-intel.h:29:49: warning[-Wunterminated-string-initialization]: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (5 chars into 4 available) # 29 | #define IMSM_NVME_OROM_COMPAT_SIGNATURE "$NVM" # | ^~~~~~ mdadm-4.3/platform-intel.c:683:38: note: in expansion of macro ‘IMSM_NVME_OROM_COMPAT_SIGNATURE’ # 683 | .signature = IMSM_NVME_OROM_COMPAT_SIGNATURE, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 27| __u8 signature[4]; # 28| #define IMSM_OROM_SIGNATURE "$VER" # 29|-> #define IMSM_NVME_OROM_COMPAT_SIGNATURE "$NVM" # 30| #define IMSM_VMD_OROM_COMPAT_SIGNATURE "$VMD" # 31| __u8 table_ver_major; /* Currently 2 (can change with future revs) */ Error: COMPILER_WARNING: [#def21] mdadm-4.3/platform-intel.c: scope_hint: In function ‘add_vmd_orom’ mdadm-4.3/platform-intel.h:30:48: warning[-Wunterminated-string-initialization]: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (5 chars into 4 available) # 30 | #define IMSM_VMD_OROM_COMPAT_SIGNATURE "$VMD" # | ^~~~~~ mdadm-4.3/platform-intel.c:751:30: note: in expansion of macro ‘IMSM_VMD_OROM_COMPAT_SIGNATURE’ # 751 | .signature = IMSM_VMD_OROM_COMPAT_SIGNATURE, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 28| #define IMSM_OROM_SIGNATURE "$VER" # 29| #define IMSM_NVME_OROM_COMPAT_SIGNATURE "$NVM" # 30|-> #define IMSM_VMD_OROM_COMPAT_SIGNATURE "$VMD" # 31| __u8 table_ver_major; /* Currently 2 (can change with future revs) */ # 32| __u8 table_ver_minor; /* Currently 2 (can change with future revs) */ Error: GCC_ANALYZER_WARNING (CWE-688): [#def22] mdadm-4.3/policy.c:340:37: warning[-Wanalyzer-null-argument]: use of NULL ‘part’ where non-null expected mdadm-4.3/policy.c:706:20: enter_function: entry to ‘domain_from_array’ mdadm-4.3/policy.c:710:12: branch_false: following ‘false’ branch (when ‘mdi’ is non-NULL)... mdadm-4.3/policy.c:712:14: branch_false: ...to here mdadm-4.3/policy.c:712:32: branch_true: following ‘true’ branch (when ‘mdi’ is non-NULL)... mdadm-4.3/policy.c:713:46: branch_true: ...to here mdadm-4.3/policy.c:713:17: call_function: calling ‘domainlist_add_dev’ from ‘domain_from_array’ # 338| for (dom = dl_next(r->dups); dom != r->dups; # 339| dom = dl_next(dom)) # 340|-> if (strcmp(dom+len+1, part)== 0) # 341| break; # 342| if (dom == r->dups) { Error: GCC_ANALYZER_WARNING (CWE-688): [#def23] mdadm-4.3/policy.c:344:61: warning[-Wanalyzer-null-argument]: use of NULL ‘part’ where non-null expected mdadm-4.3/policy.c:706:20: enter_function: entry to ‘domain_from_array’ mdadm-4.3/policy.c:710:12: branch_false: following ‘false’ branch (when ‘mdi’ is non-NULL)... mdadm-4.3/policy.c:712:14: branch_false: ...to here mdadm-4.3/policy.c:712:32: branch_true: following ‘true’ branch (when ‘mdi’ is non-NULL)... mdadm-4.3/policy.c:713:46: branch_true: ...to here mdadm-4.3/policy.c:713:17: call_function: calling ‘domainlist_add_dev’ from ‘domain_from_array’ #argument 1 of ‘__builtin_strlen’ must be non-null # 342| if (dom == r->dups) { # 343| char *newdom = dl_strndup( # 344|-> r->value, len + 1 + strlen(part)); # 345| strcat(strcat(newdom, "-"), part); # 346| dl_add(r->dups, newdom); Error: GCC_ANALYZER_WARNING (CWE-465): [#def24] mdadm-4.3/probe_roms.c:316:20: warning[-Wanalyzer-deref-before-check]: check of ‘res’ for NULL after already dereferencing it mdadm-4.3/probe_roms.c:243:6: enter_function: entry to ‘probe_roms’ mdadm-4.3/probe_roms.c:251:12: branch_false: following ‘false’ branch... mdadm-4.3/probe_roms.c:255:9: branch_false: ...to here mdadm-4.3/probe_roms.c:292:16: branch_true: following ‘true’ branch (when ‘start < upper’)... mdadm-4.3/probe_roms.c:293:23: call_function: inlined call to ‘isa_bus_to_virt’ from ‘probe_roms’ mdadm-4.3/probe_roms.c:294:22: call_function: inlined call to ‘romsignature’ from ‘probe_roms’ mdadm-4.3/probe_roms.c:313:59: call_function: calling ‘romchecksum’ from ‘probe_roms’ mdadm-4.3/probe_roms.c:313:59: return_function: returning to ‘probe_roms’ from ‘romchecksum’ mdadm-4.3/probe_roms.c:316:20: danger: pointer ‘res’ is checked for NULL here but it was already dereferenced at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3) # 314| continue; # 315| # 316|-> if (res == NULL) { # 317| res = calloc(1, sizeof(struct resource)); # 318| if (res == NULL) Error: GCC_ANALYZER_WARNING (CWE-457): [#def25] mdadm-4.3/restripe.c:598:41: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘fblock[1]’ mdadm-4.3/restripe.c:542:5: enter_function: entry to ‘save_stripes’ mdadm-4.3/restripe.c:549:39: branch_false: following ‘false’ branch (when ‘level == 0’)... mdadm-4.3/restripe.c:549:13: branch_false: ...to here mdadm-4.3/restripe.c:554:12: branch_false: following ‘false’ branch... mdadm-4.3/restripe.c:556:9: branch_false: ...to here mdadm-4.3/restripe.c:562:12: branch_false: following ‘false’ branch (when ‘length == length_test’)... branch_false: ...to here mdadm-4.3/restripe.c:571:16: branch_true: following ‘true’ branch (when ‘length != 0’)... branch_true: ...to here mdadm-4.3/restripe.c:579:32: branch_false: following ‘false’ branch (when ‘disk < data_disks’)... mdadm-4.3/restripe.c:579:32: branch_false: ...to here mdadm-4.3/restripe.c:579:32: call_function: calling ‘geo_map’ from ‘save_stripes’ mdadm-4.3/restripe.c:579:32: return_function: returning to ‘save_stripes’ from ‘geo_map’ mdadm-4.3/restripe.c:582:28: branch_false: following ‘false’ branch... mdadm-4.3/restripe.c:583:35: branch_false: ...to here mdadm-4.3/restripe.c:588:36: branch_true: following ‘true’ branch (when ‘failed <= 2’)... mdadm-4.3/restripe.c:589:41: branch_true: ...to here mdadm-4.3/restripe.c:574:32: branch_false: following ‘false’ branch (when ‘disk >= raid_disks’)... mdadm-4.3/restripe.c:595:20: branch_false: ...to here mdadm-4.3/restripe.c:595:20: branch_false: following ‘false’ branch... mdadm-4.3/restripe.c:598:25: branch_false: following ‘false’ branch (when ‘failed != 1’)... mdadm-4.3/restripe.c:598:41: branch_false: ...to here mdadm-4.3/restripe.c:598:41: danger: use of uninitialized value ‘fblock[1]’ here # 596| /* all data disks are good */ # 597| ; # 598|-> else if (failed == 1 || fblock[1] >= data_disks+1) { # 599| /* one failed data disk and good parity */ # 600| char *bufs[data_disks]; Error: CPPCHECK_WARNING (CWE-457): [#def26] mdadm-4.3/super-ddf.c:1604: error[legacyUninitvar]: Uninitialized variable: end # 1602| if (sub != NULL) # 1603| vcnum = strtoul(sub + 1, &end, 10); # 1604|-> if (sub == NULL || *sub == '\0' || *end != '\0' || # 1605| vcnum >= be16_to_cpu(ddf->active->max_vd_entries)) { # 1606| sysfs_free(sra); Error: CPPCHECK_WARNING (CWE-457): [#def27] mdadm-4.3/super-ddf.c:1605: error[legacyUninitvar]: Uninitialized variable: vcnum # 1603| vcnum = strtoul(sub + 1, &end, 10); # 1604| if (sub == NULL || *sub == '\0' || *end != '\0' || # 1605|-> vcnum >= be16_to_cpu(ddf->active->max_vd_entries)) { # 1606| sysfs_free(sra); # 1607| return DDF_NOTFOUND; Error: CPPCHECK_WARNING (CWE-457): [#def28] mdadm-4.3/super-intel.c:8348: error[legacyUninitvar]: Uninitialized variable: insync # 8346| int i; # 8347| /* gcc -Os complains that this is unused */ # 8348|-> int insync = insync; # 8349| # 8350| for (i = 0; i < map->num_members; i++) { Error: GCC_ANALYZER_WARNING (CWE-476): [#def29] mdadm-4.3/super1.c:2237:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tst.sb’ mdadm-4.3/super1.c:2208:12: enter_function: entry to ‘load_super1’ mdadm-4.3/super1.c:2218:9: call_function: calling ‘free_super1’ from ‘load_super1’ mdadm-4.3/super1.c:2218:9: return_function: returning to ‘load_super1’ from ‘free_super1’ mdadm-4.3/super1.c:2229:45: branch_true: following ‘true’ branch... mdadm-4.3/super1.c:2231:48: branch_true: ...to here mdadm-4.3/super1.c:2232:32: call_function: calling ‘load_super1’ from ‘load_super1’ mdadm-4.3/super1.c:2232:32: return_function: returning to ‘load_super1’ from ‘load_super1’ mdadm-4.3/super1.c:2229:45: branch_true: following ‘true’ branch... mdadm-4.3/super1.c:2231:48: branch_true: ...to here mdadm-4.3/super1.c:2232:32: call_function: calling ‘load_super1’ from ‘load_super1’ # 2235| bestctime < __le64_to_cpu(super->ctime)) { # 2236| bestvers = tst.minor_version; # 2237|-> bestctime = __le64_to_cpu(super->ctime); # 2238| } # 2239| free(super); Error: GCC_ANALYZER_WARNING (CWE-775): [#def30] mdadm-4.3/util.c:2211:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor # 2209| # 2210| close(0); # 2211|-> open("/dev/null", O_RDWR); # 2212| # 2213| #ifndef DEBUG Error: GCC_ANALYZER_WARNING (CWE-910): [#def31] mdadm-4.3/util.c:2214:9: warning[-Wanalyzer-fd-use-after-close]: ‘dup2’ on closed file descriptor ‘0’ mdadm-4.3/util.c:2210:9: release_resource: closed here mdadm-4.3/util.c:2214:9: danger: ‘dup2’ on closed file descriptor ‘0’; ‘close’ was at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0) # 2212| # 2213| #ifndef DEBUG # 2214|-> dup2(0, 1); # 2215| dup2(0, 2); # 2216| #endif Error: GCC_ANALYZER_WARNING (CWE-910): [#def32] mdadm-4.3/util.c:2215:9: warning[-Wanalyzer-fd-use-after-close]: ‘dup2’ on closed file descriptor ‘0’ mdadm-4.3/util.c:2210:9: release_resource: closed here mdadm-4.3/util.c:2215:9: danger: ‘dup2’ on closed file descriptor ‘0’; ‘close’ was at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0) # 2213| #ifndef DEBUG # 2214| dup2(0, 1); # 2215|-> dup2(0, 2); # 2216| #endif # 2217|
analyzer-version-clippy | 1.86.0 |
analyzer-version-cppcheck | 2.17.1 |
analyzer-version-gcc | 15.0.1 |
analyzer-version-gcc-analyzer | 15.0.1 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-79.us-west-2.compute.internal |
known-false-positives | /usr/share/csmock/known-false-positives.js |
known-false-positives-rpm | known-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch |
mock-config | fedora-rawhide-x86_64 |
project-name | mdadm-4.3-7.fc43 |
store-results-to | /tmp/tmpydx226q0/mdadm-4.3-7.fc43.tar.xz |
time-created | 2025-04-25 14:28:58 |
time-finished | 2025-04-25 14:30:50 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpydx226q0/mdadm-4.3-7.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpydx226q0/mdadm-4.3-7.fc43.src.rpm' |
tool-version | csmock-3.8.1.20250422.172604.g26bc3d6-1.el9 |