Task #31 - dosfstools-4.2-11.fc41/scan-results.err

back to task #31
download
Error: CLANG_WARNING:
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:
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:
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:
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):
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:
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,