Task #118812 - added.err
back to task #118812download
Error: CPPCHECK_WARNING (CWE-682): exfatprogs-1.4.1/fsck/fsck.c:1787: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer. # 1785| const size_t ss = 1 << bs->bsx.sect_size_bits; # 1786| uint8_t *sectors = malloc(ss * 12); # 1787|-> __le32 *const chks = (__le32*)(sectors + ss * 11); # 1788| __le32 *const chks_end = (__le32*)(sectors + ss * 12); # 1789| off_t idx = BOOT_SEC_IDX; Error: CPPCHECK_WARNING (CWE-682): exfatprogs-1.4.1/fsck/fsck.c:1788: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer. # 1786| uint8_t *sectors = malloc(ss * 12); # 1787| __le32 *const chks = (__le32*)(sectors + ss * 11); # 1788|-> __le32 *const chks_end = (__le32*)(sectors + ss * 12); # 1789| off_t idx = BOOT_SEC_IDX; # 1790| unsigned int checksum = 0; Error: GCC_ANALYZER_WARNING (CWE-688): exfatprogs-1.4.1/fsck/fsck.c:1810:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘sectors’ where non-null expected exfatprogs-1.4.1/fsck/fsck.c:1786:28: acquire_memory: this call could return NULL exfatprogs-1.4.1/fsck/fsck.c:1792:9: branch_true: following ‘true’ branch (when ‘ss > 511’)... exfatprogs-1.4.1/fsck/fsck.c:1794:12: branch_true: ...to here exfatprogs-1.4.1/fsck/fsck.c:1794:12: branch_false: following ‘false’ branch (when ‘sectors’ is non-NULL)... exfatprogs-1.4.1/fsck/fsck.c:1801:54: branch_false: ...to here exfatprogs-1.4.1/fsck/fsck.c:1803:12: branch_true: following ‘true’ branch (when ‘recursive != 0’)... exfatprogs-1.4.1/fsck/fsck.c:1804:49: branch_true: ...to here exfatprogs-1.4.1/fsck/fsck.c:1810:9: danger: argument 1 (‘sectors’) from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected # 1808| memset(bs->mbr.part_entries, 0, sizeof(bs->mbr.part_entries)); # 1809| } # 1810|-> memcpy(sectors, bs, sizeof(struct pbr)); # 1811| memset(sectors + sizeof(struct pbr), 0, ss - sizeof(struct pbr)); # 1812|