dosfstools-4.2-11.fc41

List of Defects

Error: CLANG_WARNING: [#def1]
dosfstools-4.2/src/check.c:1337:13: warning[deadcode.DeadStores]: Value stored to 'offset' is never read
# 1335|                   goto again;
# 1336|               write_volume_label(fs, fs->label);
# 1337|->             offset = find_volume_de(fs, &de);
# 1338|               /* NOTE: doslabel is not updated */
# 1339|               break;

Error: CLANG_WARNING: [#def2]
dosfstools-4.2/src/fat.c:98:55: warning[core.NullDereference]: Dereference of null pointer
#   96|       printf("Fixing first cluster in FAT.\n");
#   97|       if (fs->fat_bits == 12)
#   98|->         *(uint16_t *)first_cluster = htole16((le16toh(*(uint16_t *)first_cluster) & 0xf000) | FAT_EXTD(fs) | b.media);
#   99|       else if (fs->fat_bits == 16)
#  100|           *(uint16_t *)first_cluster = htole16(FAT_EXTD(fs) | b.media);

Error: CLANG_WARNING: [#def3]
dosfstools-4.2/src/fat.c:100:36: warning[core.NullDereference]: Dereference of null pointer
#   98|           *(uint16_t *)first_cluster = htole16((le16toh(*(uint16_t *)first_cluster) & 0xf000) | FAT_EXTD(fs) | b.media);
#   99|       else if (fs->fat_bits == 16)
#  100|->         *(uint16_t *)first_cluster = htole16(FAT_EXTD(fs) | b.media);
#  101|       else
#  102|           *(uint32_t *)first_cluster = htole32(FAT_EXTD(fs) | b.media);

Error: CLANG_WARNING: [#def4]
dosfstools-4.2/src/fat.c:102:36: warning[core.NullDereference]: Dereference of null pointer
#  100|           *(uint16_t *)first_cluster = htole16(FAT_EXTD(fs) | b.media);
#  101|       else
#  102|->         *(uint32_t *)first_cluster = htole32(FAT_EXTD(fs) | b.media);
#  103|   }
#  104|   

Error: CPPCHECK_WARNING (CWE-570): [#def5]
dosfstools-4.2/src/mkfs.fat.c:741: error[comparePointers]: Subtracting pointers that point to different objects
#  739|   
#  740|   	if (size_fat == 32) {
#  741|-> 	    int offset = (char *)&bs.fat32.boot_code -
#  742|   		(char *)&bs + MESSAGE_OFFSET + 0x7c00;
#  743|   	    if (dummy_boot_code[BOOTCODE_FAT32_SIZE - 1])

Error: CLANG_WARNING: [#def6]
dosfstools-4.2/src/mkfs.fat.c:1863:8: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1861|       if (!create) {
# 1862|   	check_mount(device_name);	/* Is the device already mounted? */
# 1863|-> 	dev = open(device_name, O_EXCL | O_RDWR);	/* Is it a suitable device to build the FS on? */
# 1864|   	if (dev < 0) {
# 1865|   	    fprintf(stderr, "%s: unable to open %s: %s\n", program_name,

Scan Properties

analyzer-version-clang18.1.3
analyzer-version-cppcheck2.13.0
analyzer-version-gcc14.0.1
analyzer-version-gcc-analyzer14.0.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-101.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namedosfstools-4.2-11.fc41
store-results-to/tmp/tmpon8jsylk/dosfstools-4.2-11.fc41.tar.xz
time-created2024-04-22 10:46:18
time-finished2024-04-22 10:47:20
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpon8jsylk/dosfstools-4.2-11.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpon8jsylk/dosfstools-4.2-11.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9