Task #1326 - xfsprogs-6.8.0-2.fc41/scan-results.err
back to task #1326download
Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:168:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/linux.h:39: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:15: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:7: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c: scope_hint: In function ‘btblock_ptr_offset’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:244:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:245:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:245:9: note: in expansion of macro ‘ASSERT’ # 166| btblock_maxrecs(struct xfs_db_btree *bt, int blocksize) # 167| { # 168|-> blocksize -= bt->block_len; # 169| # 170| return blocksize / (bt->key_len + bt->ptr_len); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c: scope_hint: In function ‘btblock_key_offset’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:226:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:223:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:224:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:224:9: note: in expansion of macro ‘ASSERT’ # 224| ASSERT(block->bb_level != 0); # 225| # 226|-> offset = bt->block_len + (idx - 1) * bt->key_len; # 227| return bitize(offset); # 228| } Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c: scope_hint: In function ‘btblock_rec_offset’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:271:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:268:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:269:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/btblock.c:269:9: note: in expansion of macro ‘ASSERT’ # 269| ASSERT(block->bb_level == 0); # 270| # 271|-> offset = bt->block_len + (idx - 1) * bt->rec_len; # 272| return bitize(offset); # 273| } Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/hash.c:207:10: warning[deadcode.DeadStores]: Although the value stored to 'dup' is used in the enclosing expression, the value is never actually read from 'dup' # 205| ASSERT(namelen < MAXNAMELEN); # 206| # 207|-> while ((dup = dup_table_find(tab, name, namelen)) != NULL) { # 208| int ret; # 209| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/hash.c:354:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 352| # 353| dup_table_free(tab); # 354|-> return error; # 355| } # 356| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/input.c:180:4: warning[deadcode.DeadStores]: Value stored to 'iscont' is never read # 178| # 179| popfile(); # 180|-> iscont = 0; # 181| rlen = 0; # 182| if (rval) { Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/input.c:181:4: warning[deadcode.DeadStores]: Value stored to 'rlen' is never read # 179| popfile(); # 180| iscont = 0; # 181|-> rlen = 0; # 182| if (rval) { # 183| xfree(rval); Error: GCC_ANALYZER_WARNING (CWE-401): xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/namei.c: scope_hint: In function ‘path_parse’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/namei.c:68:20: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 66| new_path = realloc(dirpath->path, # 67| (dirpath->depth + 1) * sizeof(char *)); # 68|-> if (!new_path) { # 69| path_free(dirpath); # 70| return NULL; Error: GCC_ANALYZER_WARNING (CWE-688): xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/namei.c: scope_hint: In function ‘path_navigate’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/namei.c:102:35: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xname.name’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 100| struct xfs_name xname = { # 101| .name = (unsigned char *)dirpath->path[i], # 102|-> .len = strlen(dirpath->path[i]), # 103| }; # 104| Error: GCC_ANALYZER_WARNING (CWE-688): xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/namei.c: scope_hint: In function ‘dir_emit’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/namei.c:270:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘display_name’ where non-null expected xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/linux.h:18: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:15: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/namei.c:6: included_from: Included from here. <built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null # 268| */ # 269| display_name = malloc(namelen + 1); # 270|-> memcpy(display_name, name, namelen); # 271| display_name[namelen] = 0; # 272| xname.len = namelen; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/write.c: scope_hint: In function ‘write_string’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/db/write.c:753:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘buf’ # 751| buf = convert_arg(argv[0], (int)((strlen(argv[0])+1)*8)); # 752| for (i = 0; i < iocur_top->len; i++) { # 753|-> ((char *)iocur_top->data)[i] = *buf; # 754| if (*buf++ == '\0') # 755| break; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/fsr/xfs_fsr.c:1189:19: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 1187| nextents = read_fd_bmap(fd, statp, &cur_nextents); # 1188| # 1189|-> if (cur_nextents == 1 || cur_nextents <= nextents) { # 1190| if (vflag) # 1191| fsrprintf(_("%s already fully defragmented.\n"), fname); Error: GCC_ANALYZER_WARNING (CWE-457): xfsprogs-6.8.0-build/xfsprogs-6.8.0/fsr/xfs_fsr.c: scope_hint: In function ‘packfile’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/fsr/xfs_fsr.c:1189:26: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cur_nextents’ # 1187| nextents = read_fd_bmap(fd, statp, &cur_nextents); # 1188| # 1189|-> if (cur_nextents == 1 || cur_nextents <= nextents) { # 1190| if (vflag) # 1191| fsrprintf(_("%s already fully defragmented.\n"), fname); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/fsr/xfs_fsr.c:1400:11: warning[deadcode.DeadStores]: Although the value stored to 'wc' is used in the enclosing expression, the value is never actually read from 'wc' # 1398| /* Do a matching write to the tmp file */ # 1399| wc_b4 = wc; # 1400|-> if (((wc = write(ffd, fbuf, wc)) != wc_b4)) { # 1401| fsrprintf(_("bad write of %d bytes " # 1402| "to %s: %s\n"), Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/scrub/repair.c:11: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/list.h:108:14: warning[unix.Malloc]: Use of memory after it is freed # 106| struct list_head *last = list->prev; # 107| # 108|-> first->prev = prev; # 109| prev->next = first; # 110| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_defer.c:6: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/libxfs_priv.h:46: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/list.h:125:3: warning[unix.Malloc]: Use of memory after it is freed # 123| { # 124| if (!list_empty(list)) { # 125|-> __list_splice(list, head, head->next); # 126| list_head_init(list); # 127| } Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/bmap.c:202:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'map' # 200| map = realloc(map, map_size*sizeof(*map)); # 201| if (map == NULL) { # 202|-> fprintf(stderr, # 203| _("%s: cannot realloc %d bytes\n"), # 204| progname, (int)(map_size*sizeof(*map))); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/bulkstat.c:292:22: warning[deadcode.DeadStores]: Value stored to 'sm' during its initialization is never read # 290| # 291| for (i = optind; i < argc; i++) { # 292|-> struct single_map *sm = tags; # 293| uint64_t ino; # 294| unsigned int flags = 0; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/encrypt.c:562:2: warning[deadcode.DeadStores]: Value stored to 'argv' is never read # 560| } # 561| argc -= optind; # 562|-> argv += optind; # 563| # 564| if (argc != 0) Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/encrypt.c:789:2: warning[deadcode.DeadStores]: Value stored to 'argv' is never read # 787| } # 788| argc -= optind; # 789|-> argv += optind; # 790| # 791| if (argc != 0) { Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/mmap.c: scope_hint: In function ‘print_mapping’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/mmap.c:45:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘map’ # 43| # 44| for (i = 0, p = pflags; p->prot != PROT_NONE; i++, p++) # 45|-> buffer[i] = (map->prot & p->prot) ? p->mode : '-'; # 46| # 47| #ifdef HAVE_MAP_SYNC Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/mmap.c:48:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘map’ # 46| # 47| #ifdef HAVE_MAP_SYNC # 48|-> if ((map->flags & (MAP_SYNC | MAP_SHARED_VALIDATE)) == # 49| (MAP_SYNC | MAP_SHARED_VALIDATE)) # 50| sprintf(&buffer[i], " S"); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/parent.c: scope_hint: In function ‘check_parent_entry’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/parent.c:88:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parent’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/parent.c: scope_hint: In function ‘check_parent_entry’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/platform_defs.h:10: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/projects.h:9: included_from: Included from here. # 86| return; # 87| } else { # 88|-> if (parent->p_ino != statbuf.st_ino) { # 89| fprintf(stderr, # 90| _("inode-path for inode: %llu is incorrect - wrong parent inode#\n"), Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/parent.c:263:2: warning[unix.Malloc]: Attempt to free released memory # 261| out: # 262| free(bstatbuf); # 263|-> free(parentbuf); # 264| free(fshandlep); # 265| return err_status; Error: GCC_ANALYZER_WARNING (CWE-415): xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/parent.c: scope_hint: In function ‘parent_check’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/parent.c:263:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘parentbuf’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/parent.c: scope_hint: In function ‘parent_check’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/platform_defs.h:35: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/io/parent.c:256:33: note: in expansion of macro ‘_’ # 261| out: # 262| free(bstatbuf); # 263|-> free(parentbuf); # 264| free(fshandlep); # 265| return err_status; Error: CPPCHECK_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/avl64.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/avl64.c:1010:7: warning[deadcode.DeadStores]: Although the value stored to 'np' is used in the enclosing expression, the value is never actually read from 'np' # 1008| newnode->avl_balance = AVL_BALANCE; # 1009| # 1010|-> if ((np = tree->avl_root) == NULL) { /* degenerate case... */ # 1011| tree->avl_root = newnode; # 1012| tree->avl_firstino = newnode; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c: scope_hint: In function '__bitmap_set' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:195:24: warning[-Wanalyzer-null-dereference]: dereference of NULL 'pos' /usr/include/urcu/assert.h:36: included_from: Included from here. /usr/include/urcu/debug.h:22: included_from: Included from here. /usr/include/urcu/static/urcu-memb.h:37: included_from: Included from here. /usr/include/urcu/urcu-memb.h:61: included_from: Included from here. /usr/include/urcu/urcu.h:39: included_from: Included from here. /usr/include/urcu.h:2: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/platform_defs.h:26: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:11: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' # 193| # 194| /* Bail if the new extent is contained within an old one. */ # 195|-> if (ext->btn_start <= start && # 196| ext->btn_start + ext->btn_length >= start + length) # 197| return 0; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:368:26: warning[core.NullDereference]: Access to field 'avl_nextino' results in a dereference of a null pointer (loaded from variable 'pos') # 366| goto out; # 367| # 368|-> avl_for_each_range_safe(pos, n, l, firstn, lastn) { # 369| ext = container_of(pos, struct bitmap_node, btn_node); # 370| ret = fn(ext->btn_start, ext->btn_length, arg); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c: scope_hint: In function 'bitmap_iterate_range' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:370:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'pos' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' # 368| avl_for_each_range_safe(pos, n, l, firstn, lastn) { # 369| ext = container_of(pos, struct bitmap_node, btn_node); # 370|-> ret = fn(ext->btn_start, ext->btn_length, arg); # 371| if (ret) # 372| break; Error: CPPCHECK_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/list_sort.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/list_sort.c:75:20: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer (loaded from field 'next') # 73| (*cmp)(priv, tail->next, tail->next); # 74| # 75|-> tail->next->prev = tail; # 76| tail = tail->next; # 77| } while (tail->next); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/list_sort.c: scope_hint: In function 'merge_and_restore_back_links' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/list_sort.c:75:34: warning[-Wanalyzer-null-dereference]: dereference of NULL 'list' # 73| (*cmp)(priv, tail->next, tail->next); # 74| # 75|-> tail->next->prev = tail; # 76| tail = tail->next; # 77| } while (tail->next); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/radix-tree.c:452:8: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value # 450| # 451| do { # 452|-> if (!tag_get(pathp->node, tag, pathp->offset)) # 453| goto out; # 454| tag_clear(pathp->node, tag, pathp->offset); Error: GCC_ANALYZER_WARNING (CWE-835): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/radix-tree.c: scope_hint: In function 'radix_tree_gang_lookup' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/radix-tree.c:534:20: warning[-Wanalyzer-infinite-loop]: infinite loop # 532| unsigned int ret = 0; # 533| # 534|-> while (ret < max_items) { # 535| unsigned int nr_found; # 536| unsigned long next_index; /* Index of next search */ Error: GCC_ANALYZER_WARNING (CWE-835): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/radix-tree.c: scope_hint: In function 'radix_tree_gang_lookup_ex' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/radix-tree.c:574:20: warning[-Wanalyzer-infinite-loop]: infinite loop # 572| unsigned int ret = 0; # 573| # 574|-> while (ret < max_items && cur_index < last_index) { # 575| unsigned int nr_found; # 576| unsigned long next_index; /* Index of next search */ Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/radix-tree.c:762:7: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value # 760| for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) { # 761| tags[tag] = 1; # 762|-> if (tag_get(pathp->node, tag, pathp->offset)) { # 763| tag_clear(pathp->node, tag, pathp->offset); # 764| if (!any_tag_set(pathp->node, tag)) { Error: CPPCHECK_WARNING (CWE-758): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/util.c:20: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 18| # 19| for (rval = 0; rval < NBBY * sizeof(i); rval++) { # 20|-> if ((1 << rval) >= i) # 21| break; # 22| } Error: CPPCHECK_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libfrog/workqueue.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxcmd/input.c:108:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'rval' # 106| } # 107| *count = c; # 108|-> return rval; # 109| } # 110| Error: GCC_ANALYZER_WARNING (CWE-401): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxcmd/input.c: scope_hint: In function 'breakline' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxcmd/input.c:108:16: warning[-Wanalyzer-malloc-leak]: leak of 'rval' # 106| } # 107| *count = c; # 108|-> return rval; # 109| } # 110| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_ag_resv.c: scope_hint: In function '__xfs_ag_resv_free' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_ag_resv.c:141:56: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_ag_resv.c: scope_hint: In function '__xfs_ag_resv_free' # 139| resv = xfs_perag_resv(pag, type); # 140| if (pag->pag_agno == 0) # 141|-> pag->pag_mount->m_ag_max_usable += resv->ar_asked; # 142| /* # 143| * RMAPBT blocks come from the AGFL and AGFL blocks are always Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_ag_resv.c:150:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_ag_resv.c: scope_hint: In function '__xfs_ag_resv_free' # 148| oldresv = resv->ar_orig_reserved; # 149| else # 150|-> oldresv = resv->ar_reserved; # 151| error = xfs_mod_fdblocks(pag->pag_mount, oldresv, true); # 152| resv->ar_reserved = 0; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_alloc.c:324:9: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 322| # 323| /* Trim busy sections out of found extent */ # 324|-> busy = xfs_extent_busy_trim(args, &bno, &len, busy_gen); # 325| # 326| /* Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_alloc.c:1027:16: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 1025| return error; # 1026| ASSERT(len >= acur->cur_len); # 1027|-> acur->cur_len = len; # 1028| # 1029| /* Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_alloc.c:1227:2: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 1225| tbno = fbno; # 1226| tlen = flen; # 1227|-> xfs_extent_busy_trim(args, &tbno, &tlen, &busy_gen); # 1228| # 1229| /* Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_alloc.c:3915:3: warning[deadcode.DeadStores]: Value stored to 'busy_flags' is never read # 3913| # 3914| if (skip_discard) # 3915|-> busy_flags |= XFS_EXTENT_BUSY_SKIP_DISCARD; # 3916| xfs_extent_busy_insert(tp, pag, agbno, len, busy_flags); # 3917| return 0; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr.c:612:2: warning[deadcode.DeadStores]: Value stored to 'error' is never read # 610| if (error != -EEXIST) # 611| goto out; # 612|-> error = 0; # 613| # 614| state = attr->xattri_da_state; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr.c:1445:2: warning[deadcode.DeadStores]: Value stored to 'error' is never read # 1443| goto out; # 1444| # 1445|-> error = xfs_attr_node_removename(args, state); # 1446| # 1447| /* Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_leaf.c:730:27: warning[deadcode.DeadStores]: Value stored to 'sf' during its initialization is never read # 728| struct xfs_mount *mp = dp->i_mount; # 729| struct xfs_ifork *ifp = &dp->i_af; # 730|-> struct xfs_attr_sf_hdr *sf = ifp->if_data; # 731| struct xfs_attr_sf_entry *sfe; # 732| int size; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_leaf.c:914:3: warning[deadcode.DeadStores]: Value stored to 'error' is never read # 912| sfe->namelen); # 913| nargs.attr_filter = sfe->flags & XFS_ATTR_NSP_ONDISK_MASK; # 914|-> error = xfs_attr3_leaf_lookup_int(bp, &nargs); /* set a->index */ # 915| ASSERT(error == -ENOATTR); # 916| error = xfs_attr3_leaf_add(bp, &nargs); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_leaf.c:2567:4: warning[deadcode.DeadStores]: Value stored to 'tmp' is never read # 2565| ichdr_s->count -= 1; # 2566| ichdr_d->count += 1; # 2567|-> tmp = ichdr_d->count * sizeof(xfs_attr_leaf_entry_t) # 2568| + xfs_attr3_leaf_hdr_size(leaf_d); # 2569| ASSERT(ichdr_d->firstused >= tmp); Error: GCC_ANALYZER_WARNING (CWE-126): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:10: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c: scope_hint: In function 'xfs_attr_rmtval_get' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:61: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:61: note: read of 8 bytes from after the end of 'map' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:61: note: valid subscripts for 'map' are '[0]' to '[0]' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' # └─────────────────────────────────┘ # ^ # 414| ASSERT((map[i].br_startblock != DELAYSTARTBLOCK) && # 415| (map[i].br_startblock != HOLESTARTBLOCK)); # 416|-> dblkno = XFS_FSB_TO_DADDR(mp, map[i].br_startblock); # 417| dblkcnt = XFS_FSB_TO_BB(mp, map[i].br_blockcount); # 418| error = xfs_buf_read(mp->m_ddev_targp, dblkno, dblkcnt, Error: GCC_ANALYZER_WARNING (CWE-126): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:417:59: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:417:59: note: read of 8 bytes from after the end of 'map' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:417:59: note: valid subscripts for 'map' are '[0]' to '[0]' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' # └─────────────────────────────────┘ # ^ # 415| (map[i].br_startblock != HOLESTARTBLOCK)); # 416| dblkno = XFS_FSB_TO_DADDR(mp, map[i].br_startblock); # 417|-> dblkcnt = XFS_FSB_TO_BB(mp, map[i].br_blockcount); # 418| error = xfs_buf_read(mp->m_ddev_targp, dblkno, dblkcnt, # 419| 0, &bp, &xfs_attr3_rmt_buf_ops); Error: GCC_ANALYZER_WARNING (CWE-126): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:431:41: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:431:41: note: read of 8 bytes from after the end of 'map' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_attr_remote.c:431:41: note: valid subscripts for 'map' are '[0]' to '[0]' # └─────────────────────────────────┘ # ^ # 429| # 430| /* roll attribute extent map forwards */ # 431|-> lblkno += map[i].br_blockcount; # 432| blkcnt -= map[i].br_blockcount; # 433| } Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/libxfs_priv.h:59: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap_btree.c:6: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap_btree.c: scope_hint: In function 'xfs_bmbt_init_cursor' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap_btree.c:582:42: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap_btree.c:582:27: note: in expansion of macro 'be16_to_cpu' xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap_btree.c:582:27: note: in expansion of macro 'be16_to_cpu' # 580| cur = xfs_bmbt_init_common(mp, tp, ip, whichfork); # 581| # 582|-> cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; # 583| cur->bc_ino.forksize = xfs_inode_fork_size(ip, whichfork); # 584| cur->bc_ino.whichfork = whichfork; Error: GCC_ANALYZER_WARNING (CWE-688): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap_btree.c: scope_hint: In function 'libxfs_bmbt_commit_staged_btree' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap_btree.c:653:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected <built-in>: note: argument 1 of '__builtin_memcpy' must be non-null # 651| ifp = xfs_ifork_ptr(cur->bc_ino.ip, whichfork); # 652| xfs_idestroy_fork(ifp); # 653|-> memcpy(ifp, ifake->if_fork, sizeof(struct xfs_ifork)); # 654| # 655| switch (ifp->if_format) { Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap_btree.c:657:9: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 655| switch (ifp->if_format) { # 656| case XFS_DINODE_FMT_EXTENTS: # 657|-> flags |= extflag[whichfork]; # 658| break; # 659| case XFS_DINODE_FMT_BTREE: Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap_btree.c:660:9: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 658| break; # 659| case XFS_DINODE_FMT_BTREE: # 660|-> flags |= brootflag[whichfork]; # 661| break; # 662| default: Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_da_btree.c:468:12: warning[core.NullDereference]: Access to field 'b_ops' results in a dereference of a null pointer (loaded from variable 'bp') # 466| if (error) # 467| return error; # 468|-> bp->b_ops = &xfs_da3_node_buf_ops; # 469| xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF); # 470| node = bp->b_addr; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_da_btree.c:698:2: warning[deadcode.DeadStores]: Value stored to 'node' is never read # 696| if (error) # 697| return error; # 698|-> node = bp->b_addr; # 699| oldroot = blk1->bp->b_addr; # 700| if (oldroot->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC) || Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_da_btree.c:698:9: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from variable 'bp') # 696| if (error) # 697| return error; # 698|-> node = bp->b_addr; # 699| oldroot = blk1->bp->b_addr; # 700| if (oldroot->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC) || Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_da_btree.c:1614:10: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from field 'bp') # 1612| return error; # 1613| } # 1614|-> curr = blk->bp->b_addr; # 1615| magic = be16_to_cpu(curr->magic); # 1616| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_da_btree.c:2040:10: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from field 'bp') # 2038| blk->bp = bp; # 2039| # 2040|-> info = blk->bp->b_addr; # 2041| ASSERT(info->magic == cpu_to_be16(XFS_DA_NODE_MAGIC) || # 2042| info->magic == cpu_to_be16(XFS_DA3_NODE_MAGIC) || Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_da_btree.c:2206:22: warning[core.NullDereference]: Dereference of null pointer # 2204| for (i = 0, got = 0; i < mapi; i++) # 2205| got += mapp[i].br_blockcount; # 2206|-> if (got != count || mapp[0].br_startoff != *bno || # 2207| mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount != # 2208| *bno + count) { Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_da_btree.c: scope_hint: In function 'xfs_da_grow_inode_int' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_da_btree.c:2206:36: warning[-Wanalyzer-null-dereference]: dereference of NULL 'mapp' # 2204| for (i = 0, got = 0; i < mapi; i++) # 2205| got += mapp[i].br_blockcount; # 2206|-> if (got != count || mapp[0].br_startoff != *bno || # 2207| mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount != # 2208| *bno + count) { Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_defer.c:615:3: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value # 613| out: # 614| if (ops->finish_cleanup) # 615|-> ops->finish_cleanup(tp, state, error); # 616| return error; # 617| } Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_defer.c:616:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 614| if (ops->finish_cleanup) # 615| ops->finish_cleanup(tp, state, error); # 616|-> return error; # 617| } # 618| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_block.c:878:8: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of an undefined pointer value (loaded from variable 'bp') # 876| } # 877| dp = args->dp; # 878|-> hdr = bp->b_addr; # 879| btp = xfs_dir2_block_tail_p(args->geo, hdr); # 880| blp = xfs_dir2_block_leaf_p(btp); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_block.c: scope_hint: In function 'xfs_dir2_sf_to_block' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_block.c:1234:36: warning[-Wanalyzer-null-dereference]: dereference of NULL 'sfep' # 1232| dep = bp->b_addr + newoffset; # 1233| dep->inumber = cpu_to_be64(xfs_dir2_sf_get_ino(mp, sfp, sfep)); # 1234|-> dep->namelen = sfep->namelen; # 1235| xfs_dir2_data_put_ftype(mp, dep, # 1236| xfs_dir2_sf_get_ftype(mp, sfep)); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_data.c:253:27: warning[core.NullDereference]: Access to field 'count' results in a dereference of a null pointer (loaded from variable 'btp') # 251| if (hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC) || # 252| hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC)) { # 253|-> for (i = stale = 0; i < be32_to_cpu(btp->count); i++) { # 254| if (lep[i].address == # 255| cpu_to_be32(XFS_DIR2_NULL_DATAPTR)) Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_data.c:928:4: warning[deadcode.DeadStores]: Value stored to 'dfp' is never read # 926| * Now insert the new entry. # 927| */ # 928|-> dfp = xfs_dir2_data_freeinsert(hdr, bf, prevdup, # 929| needlogp); # 930| ASSERT(dfp == &bf[0]); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_leaf.c:602:14: warning[core.UndefinedBinaryOperatorResult]: The right operand of '<' is a garbage value # 600| (highstale - index) * sizeof(xfs_dir2_leaf_entry_t)); # 601| } # 602|-> *lfloglow = min(index, *lfloglow); # 603| *lfloghigh = max(highstale, *lfloghigh); # 604| leafhdr->stale--; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_leaf.c:1288:43: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from variable 'dbp') # 1286| * Point to the data entry. # 1287| */ # 1288|-> dep = (xfs_dir2_data_entry_t *)((char *)dbp->b_addr + # 1289| xfs_dir2_dataptr_to_off(args->geo, # 1290| be32_to_cpu(lep->address))); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_leaf.c: scope_hint: In function 'xfs_dir2_leaf_lookup_int' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_leaf.c:1288:60: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbp' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/libxfs_priv.h:59: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_leaf.c:7: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:134:31: note: in definition of macro '__swab32' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_leaf.c:1257:25: note: in expansion of macro 'be32_to_cpu' xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:134:31: note: in definition of macro '__swab32' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_leaf.c:1262:21: note: in expansion of macro 'be32_to_cpu' # 1286| * Point to the data entry. # 1287| */ # 1288|-> dep = (xfs_dir2_data_entry_t *)((char *)dbp->b_addr + # 1289| xfs_dir2_dataptr_to_off(args->geo, # 1290| be32_to_cpu(lep->address))); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_leaf.c:1517:9: warning[core.uninitialized.ArraySubscript]: Array subscript is undefined # 1515| * Point to the leaf entry, get data address from it. # 1516| */ # 1517|-> lep = &leafhdr.ents[index]; # 1518| /* # 1519| * Point to the data entry. Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_node.c:870:43: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from variable 'curbp') # 868| * Point to the data entry. # 869| */ # 870|-> dep = (xfs_dir2_data_entry_t *)((char *)curbp->b_addr + # 871| xfs_dir2_dataptr_to_off(args->geo, # 872| be32_to_cpu(lep->address))); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_node.c:1507:2: warning[deadcode.DeadStores]: Value stored to 'ents' is never read # 1505| leaf = blk->bp->b_addr; # 1506| xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); # 1507|-> ents = leafhdr.ents; # 1508| xfs_dir3_leaf_check(dp, blk->bp); # 1509| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_dir2_node.c:1569:3: warning[deadcode.DeadStores]: Value stored to 'ents' is never read # 1567| leaf = bp->b_addr; # 1568| xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &hdr2, leaf); # 1569|-> ents = hdr2.ents; # 1570| count += hdr2.count - hdr2.stale; # 1571| bytes -= count * sizeof(ents[0]); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_ialloc.c:1140:23: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 1138| xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); # 1139| # 1140|-> pag->pagl_leftrec = trec.ir_startino; # 1141| pag->pagl_rightrec = rec.ir_startino; # 1142| pag->pagl_pagino = pagino; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_ialloc.c:1247:18: warning[core.BitwiseShift]: Right operand is negative in left shift # 1245| XFS_INODES_PER_CHUNK) == 0); # 1246| ino = XFS_AGINO_TO_INO(mp, pag->pag_agno, rec.ir_startino + offset); # 1247|-> rec.ir_free &= ~XFS_INOBT_MASK(offset); # 1248| rec.ir_freecount--; # 1249| error = xfs_inobt_update(cur, &rec); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_ialloc.c:1509:18: warning[core.BitwiseShift]: Right operand is negative in left shift # 1507| * Modify or remove the finobt record. # 1508| */ # 1509|-> rec.ir_free &= ~XFS_INOBT_MASK(offset); # 1510| rec.ir_freecount--; # 1511| if (rec.ir_freecount) Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_ialloc.c:2674:24: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>' is a garbage value # 2672| if (error) # 2673| return error; # 2674|-> if (irec.ir_startino > high) # 2675| break; # 2676| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_iext_tree.c:525:19: warning[core.NullDereference]: Array access (via field 'keys') results in a null pointer dereference # 523| # 524| for (i = nr_entries; i > pos; i--) { # 525|-> node->keys[i] = node->keys[i - 1]; # 526| node->ptrs[i] = node->ptrs[i - 1]; # 527| } Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_iext_tree.c:528:18: warning[core.NullDereference]: Array access (via field 'keys') results in a null pointer dereference # 526| node->ptrs[i] = node->ptrs[i - 1]; # 527| } # 528|-> node->keys[pos] = offset; # 529| node->ptrs[pos] = ptr; # 530| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_iext_tree.c:659:24: warning[core.NullDereference]: Array access (via field 'recs') results in a null pointer dereference # 657| # 658| for (i = nr_entries; i > cur->pos; i--) # 659|-> cur->leaf->recs[i] = cur->leaf->recs[i - 1]; # 660| xfs_iext_set(cur_rec(cur), irec); # 661| ifp->if_bytes += sizeof(struct xfs_iext_rec); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'libxfs_init_local_fork' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:57:30: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 55| new_data[size] = '\0'; # 56| # 57|-> ifp->if_data = new_data; # 58| } else { # 59| ifp->if_data = NULL; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:59:30: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 57| ifp->if_data = new_data; # 58| } else { # 59|-> ifp->if_data = NULL; # 60| } # 61| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iformat_extents' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:128:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 126| } # 127| # 128|-> ifp->if_bytes = 0; # 129| ifp->if_data = NULL; # 130| ifp->if_height = 0; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:7: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iformat_btree' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:191:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/libxfs_priv.h:196:34: note: in definition of macro 'unlikely' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/libxfs_priv.h:196:34: note: in definition of macro 'unlikely' # 189| * blocks. # 190| */ # 191|-> if (unlikely(ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork) || # 192| nrecs == 0 || # 193| XFS_BMDR_SPACE_CALC(nrecs) > Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iroot_realloc' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:398:24: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 396| * allocate it now and get out. # 397| */ # 398|-> if (ifp->if_broot_bytes == 0) { # 399| new_size = XFS_BMAP_BROOT_SPACE_CALC(mp, rec_diff); # 400| ifp->if_broot = kmem_alloc(new_size, KM_NOFS); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:433:43: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 431| */ # 432| ASSERT((ifp->if_broot != NULL) && (ifp->if_broot_bytes > 0)); # 433|-> cur_max = xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, 0); # 434| new_max = cur_max + rec_diff; # 435| ASSERT(new_max >= 0); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:460:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 458| op = (char *)XFS_BMBT_REC_ADDR(mp, ifp->if_broot, 1); # 459| np = (char *)XFS_BMBT_REC_ADDR(mp, new_broot, 1); # 460|-> memcpy(np, op, new_max * (uint)sizeof(xfs_bmbt_rec_t)); # 461| # 462| /* Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'libxfs_idata_realloc' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:503:47: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 501| { # 502| struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); # 503|-> int64_t new_size = ifp->if_bytes + byte_diff; # 504| # 505| ASSERT(new_size >= 0); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:623:24: warning[core.UndefinedBinaryOperatorResult]: The right operand of '&' is a garbage value due to array index out of bounds # 621| switch (ifp->if_format) { # 622| case XFS_DINODE_FMT_LOCAL: # 623|-> if ((iip->ili_fields & dataflag[whichfork]) && # 624| (ifp->if_bytes > 0)) { # 625| ASSERT(ifp->if_data != NULL); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:632:24: warning[core.UndefinedBinaryOperatorResult]: The right operand of '&' is a garbage value due to array index out of bounds # 630| # 631| case XFS_DINODE_FMT_EXTENTS: # 632|-> if ((iip->ili_fields & extflag[whichfork]) && # 633| (ifp->if_bytes > 0)) { # 634| ASSERT(ifp->if_nextents > 0); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:641:24: warning[core.UndefinedBinaryOperatorResult]: The right operand of '&' is a garbage value due to array index out of bounds # 639| # 640| case XFS_DINODE_FMT_BTREE: # 641|-> if ((iip->ili_fields & brootflag[whichfork]) && # 642| (ifp->if_broot_bytes > 0)) { # 643| ASSERT(ifp->if_broot != NULL); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iext_count_may_overflow' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c:773:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iext_count_may_overflow' # 771| max_exts = 10; # 772| # 773|-> nr_exts = ifp->if_nextents + nr_to_add; # 774| if (nr_exts < ifp->if_nextents || nr_exts > max_exts) # 775| return -EFBIG; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_inode_fork.h:84:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap.c: scope_hint: In function '__xfs_bunmapi' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap.c:6: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/libxfs_priv.h:196:34: note: in definition of macro 'unlikely' xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_bmap.c:5283:13: note: in expansion of macro 'XFS_IS_CORRUPT' # 82| static inline bool xfs_ifork_has_extents(struct xfs_ifork *ifp) # 83| { # 84|-> return ifp->if_format == XFS_DINODE_FMT_EXTENTS || # 85| ifp->if_format == XFS_DINODE_FMT_BTREE; # 86| } Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_refcount.c:2002:2: warning[unix.Malloc]: Use of memory after it is freed # 2000| out_free: # 2001| /* Free the leftover list */ # 2002|-> list_for_each_entry_safe(rr, n, &debris, rr_list) { # 2003| list_del(&rr->rr_list); # 2004| kfree(rr); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_rmap.c:275:2: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value # 273| "Reverse Mapping BTree record corruption in AG %d detected at %pS!", # 274| cur->bc_ag.pag->pag_agno, fa); # 275|-> xfs_warn(mp, # 276| "Owner 0x%llx, flags 0x%x, start block 0x%x block count 0x%x", # 277| irec->rm_owner, irec->rm_flags, irec->rm_startblock, Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_rmap.c:2451:2: warning[deadcode.DeadStores]: Value stored to 'bno' is never read # 2449| bool unwritten; # 2450| # 2451|-> bno = XFS_FSB_TO_AGBNO(mp, ri->ri_bmap.br_startblock); # 2452| # 2453| trace_xfs_rmap_deferred(mp, ri->ri_pag->pag_agno, ri->ri_type, bno, Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxlog/xfs_log_recover.c:1512:4: warning[deadcode.DeadStores]: Value stored to 'wrapped_hblks' is never read # 1510| offset = hbp->b_addr; # 1511| split_hblks = 0; # 1512|-> wrapped_hblks = 0; # 1513| if (blk_no + hblks <= log->l_logBBsize) { # 1514| /* Read header in one read */ Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c: scope_hint: In function ‘xlog_print_add_to_trans’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:144:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘item’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:804:39: note: in definition of macro ‘BBTOOFF64’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs.h:46: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:15: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:6: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_fs.h:854:27: note: in definition of macro ‘BBTOB’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:853:28: note: in expansion of macro ‘BTOBB’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:34: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/libxfs/xfs_log_format.h:52:32: note: in definition of macro ‘BLOCK_LSN’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:209:34: note: in expansion of macro ‘__swab64’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:872:19: note: in expansion of macro ‘be64_to_cpu’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:30: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:970:13: note: in expansion of macro ‘be32_to_cpu’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1085:41: note: in expansion of macro ‘be32_to_cpu’ # 142| # 143| item = (xlog_split_item_t *)calloc(sizeof(xlog_split_item_t), 1); # 144|-> item->si_xtid = tid; # 145| item->si_skip = skip; # 146| item->si_next = split_list; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1350:10: warning[deadcode.DeadStores]: Although the value stored to 'error' is used in the enclosing expression, the value is never actually read from 'error' # 1348| * we still end at the end of the logical log. # 1349| */ # 1350|-> if ((error = xlog_print_find_oldest(log, &block_end))) { # 1351| fprintf(stderr, _("%s: problem finding oldest LR\n"), progname); # 1352| return; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1409:10: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 1407| # 1408| if (be32_to_cpu(hdr->h_version) == 2) { # 1409|-> if (xlog_print_extended_headers(fd, len, &blkno, hdr, &num_hdrs, &xhdrs) != 0) # 1410| break; # 1411| } Error: GCC_ANALYZER_WARNING (CWE-457): xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c: scope_hint: In function ‘xfs_log_print’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1409:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:804:39: note: in definition of macro ‘BBTOOFF64’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1408:13: note: in expansion of macro ‘be32_to_cpu’ # 1407| # 1408| if (be32_to_cpu(hdr->h_version) == 2) { # 1409|-> if (xlog_print_extended_headers(fd, len, &blkno, hdr, &num_hdrs, &xhdrs) != 0) # 1410| break; # 1411| } Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1413:10: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value # 1411| } # 1412| # 1413|-> error = xlog_print_record(log, fd, num_ops, len, &read_type, &partial_buf, # 1414| hdr, xhdrs, first_hdr_found); # 1415| first_hdr_found++; Error: GCC_ANALYZER_WARNING (CWE-457): xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1413:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:804:39: note: in definition of macro ‘BBTOOFF64’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1408:13: note: in expansion of macro ‘be32_to_cpu’ # 1411| } # 1412| # 1413|-> error = xlog_print_record(log, fd, num_ops, len, &read_type, &partial_buf, # 1414| hdr, xhdrs, first_hdr_found); # 1415| first_hdr_found++; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1459:3: warning[deadcode.DeadStores]: Value stored to 'cleared' is never read # 1457| printf(_("%s: totally cleared log\n"), progname); # 1458| # 1459|-> cleared=0; # 1460| } # 1461| if (zeroed) { Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1469:3: warning[deadcode.DeadStores]: Value stored to 'zeroed' is never read # 1467| printf(_("%s: totally zeroed log\n"), progname); # 1468| # 1469|-> zeroed=0; # 1470| } # 1471| printf(_("%s: physical end of log\n"), progname); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/logprint/log_misc.c:1535:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'xhdrs' # 1533| # 1534| end: # 1535|-> printf(_("%s: logical end of log\n"), progname); # 1536| print_xlog_record_line(); # 1537| } Error: GCC_ANALYZER_WARNING (CWE-617): xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘fatal’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:42:9: warning[-Wanalyzer-tainted-assertion]: use of attacked-controlled value in condition for assertion # 40| fprintf(stderr, "%s: ", progname); # 41| vfprintf(stderr, msg, args); # 42|-> exit(1); # 43| } # 44| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:125:6: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 123| *is_file = false; # 124| # 125|-> if (stat(path, &statbuf) < 0) { # 126| /* ok, assume it's a file and create it */ # 127| open_flags |= O_CREAT; Error: GCC_ANALYZER_WARNING (CWE-688): xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘open_device’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:125:13: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:30: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:7: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:555:17: note: in expansion of macro ‘be32_to_cpu’ /usr/include/features.h:511: included_from: Included from here. /usr/include/bits/libc-header-start.h:33: included_from: Included from here. /usr/include/stdio.h:28: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/platform_defs.h:9: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:14: included_from: Included from here. /usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null # 123| *is_file = false; # 124| # 125|-> if (stat(path, &statbuf) < 0) { # 126| /* ok, assume it's a file and create it */ # 127| open_flags |= O_CREAT; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:232:6: warning[unix.StdCLibraryFunctions]: The 1st argument to 'fread' is NULL but should not be NULL # 230| block_buffer = (char *)metablock + block_size; # 231| # 232|-> if (fread(block_index, block_size - sizeof(struct xfs_metablock), 1, # 233| md_fp) != 1) # 234| fatal("error reading from metadump file\n"); Error: GCC_ANALYZER_WARNING (CWE-617): xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘restore_v2’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:403:17: warning[-Wanalyzer-tainted-assertion]: use of attacked-controlled value in condition for assertion # 401| (be64_to_cpu(xme.xme_addr) & XME_ADDR_DEVICE_MASK) != # 402| XME_ADDR_DATA_DEVICE) # 403|-> fatal("Invalid superblock disk address/length\n"); # 404| # 405| len = BBTOB(be32_to_cpu(xme.xme_len)); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:407:6: warning[unix.StdCLibraryFunctions]: The 1st argument to 'fread' is NULL but should not be NULL # 405| len = BBTOB(be32_to_cpu(xme.xme_len)); # 406| # 407|-> if (fread(block_buffer, len, 1, md_fp) != 1) # 408| fatal("error reading from metadump file\n"); # 409| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:415:50: warning[core.NullDereference]: Access to field 'sb_inprogress' results in a dereference of a null pointer (loaded from variable 'block_buffer') # 413| fatal("bad magic number for primary superblock\n"); # 414| # 415|-> ((struct xfs_dsb *)block_buffer)->sb_inprogress = 1; # 416| # 417| verify_device_size(ddev_fd, is_data_target_file, sb.sb_dblocks, Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:461:3: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 459| len = BBTOB(be32_to_cpu(xme.xme_len)); # 460| # 461|-> restore_meta_extent(md_fp, fd, device, block_buffer, offset, # 462| len); # 463| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/mdrestore/xfs_mdrestore.c:552:6: warning[core.NonNullParamChecker]: Null pointer passed to 4th parameter expecting 'nonnull' # 550| } # 551| # 552|-> if (fread(&headers.magic, sizeof(headers.magic), 1, src_f) != 1) # 553| fatal("Unable to read metadump magic from metadump file\n"); # 554| Error: GCC_ANALYZER_WARNING (CWE-688): xfsprogs-6.8.0-build/xfsprogs-6.8.0/mkfs/proto.c: scope_hint: In function ‘getnum.part.0’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/mkfs/proto.c:50:13: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected xfsprogs-6.8.0-build/xfsprogs-6.8.0/mkfs/proto.c: scope_hint: In function ‘getnum.part.0’ /usr/include/features.h:511: included_from: Included from here. /usr/include/bits/libc-header-start.h:33: included_from: Included from here. /usr/include/stdio.h:28: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/platform_defs.h:9: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:14: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/mkfs/proto.c:7: included_from: Included from here. /usr/include/stdlib.h:238:22: note: argument 1 of ‘strtoll’ must be non-null # 48| return cvtnum(blksize, sectsize, str); # 49| # 50|-> i = strtoll(str, &sp, 0); # 51| if (i == 0 && sp == str) # 52| return -1LL; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/mkfs/proto.c: scope_hint: In function ‘parseproto’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/mkfs/proto.c:419:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘name’ # 417| memset(&creds, 0, sizeof(creds)); # 418| mstr = getstr(pp); # 419|-> switch (mstr[0]) { # 420| case '-': # 421| fmt = IF_REGULAR; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/mkfs/xfs_mkfs.c:2801:29: warning[core.BitwiseShift]: Right operand is negative in left shift # 2799| ft->data.sunit = 0; # 2800| ft->data.swidth = 0; # 2801|-> } else if (cfg->dblocks < GIGABYTES(1, cfg->blocklog)) { # 2802| /* # 2803| * Don't use automatic stripe detection if the device Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/mkfs/xfs_mkfs.c:3180:19: warning[core.BitwiseShift]: Right operand is negative in left shift # 3178| try_threads = nr_threads; # 3179| try_agsize = cfg->dblocks / try_threads; # 3180|-> if (try_agsize < GIGABYTES(4, cfg->blocklog)) { # 3181| do { # 3182| try_threads--; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/quota/edit.c:110:14: warning[deadcode.DeadStores]: Value stored to 'type_name' during its initialization is never read # 108| { # 109| uint32_t id = -1; # 110|-> const char *type_name = "unknown type"; # 111| # 112| switch (type) { Error: GCC_ANALYZER_WARNING (CWE-126): xfsprogs-6.8.0-build/xfsprogs-6.8.0/quota/edit.c: scope_hint: In function ‘restore_file’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/quota/edit.c:342:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.8.0-build/xfsprogs-6.8.0/quota/edit.c:342:25: note: read of 4 bytes from after the end of ‘buffer’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/quota/edit.c:342:25: note: valid subscripts for ‘buffer’ are ‘[0]’ to ‘[511]’ # └───────────────────────────────────────────────────────────┘ # ^ ^ ^ # 340| * newline, and move on to the next line. # 341| */ # 342|-> strncpy(dev, buffer + 5, sizeof(dev) - 1); # 343| dev[strlen(dev) - 1] = '\0'; # 344| continue; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/quota/free.c:268:32: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>>' is a garbage value # 266| else # 267| fprintf(fp, " %10llu %10llu %10llu %3s%%", # 268|-> (unsigned long long)bcount >> 1, # 269| (unsigned long long)bused >> 1, # 270| (unsigned long long)bfree >> 1, Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/agbtree.c: scope_hint: In function ‘get_inobt_records’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/agbtree.c:415:44: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/agbtree.c:11: included_from: Included from here. # 413| # 414| /* Transform the incore record into an on-disk record. */ # 415|-> irec->ir_startino = ino_rec->ino_startnum; # 416| irec->ir_free = ino_rec->ir_free; # 417| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/attr_repair.c: scope_hint: In function ‘set_da_freemap’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/attr_repair.c:70:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘map’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:33: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/attr_repair.c:7: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/attr_repair.c:1137:25: note: in expansion of macro ‘XFS_FSB_TO_BB’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/attr_repair.c: scope_hint: In function ‘set_da_freemap’ # 68| # 69| for (i = start; i < stop; i ++) { # 70|-> if (map[i / NBBY] & (mask << i % NBBY)) { # 71| do_warn(_("multiply claimed byte %d in da block\n"), i); # 72| return(1); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/avl.c:990:7: warning[deadcode.DeadStores]: Although the value stored to 'np' is used in the enclosing expression, the value is never actually read from 'np' # 988| newnode->avl_balance = AVL_BALANCE; # 989| # 990|-> if ((np = tree->avl_root) == NULL) { /* degenerate case... */ # 991| tree->avl_root = newnode; # 992| tree->avl_firstino = newnode; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/bulkload.c:247:2: warning[unix.Malloc]: Use of memory after it is freed # 245| * reservations. # 246| */ # 247|-> list_for_each_entry_safe(resv, n, &bkl->resv_list, list) { # 248| list_del(&resv->list); # 249| libxfs_perag_put(resv->pag); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/dino_chunks.c:811:3: warning[deadcode.DeadStores]: Value stored to 'status' is never read # 809| bp_index = 0; # 810| icnt = 0; # 811|-> status = 0; # 812| } # 813| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/dinode.c:1162:2: warning[deadcode.DeadStores]: Value stored to 'dqid' is never read # 1160| dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); # 1161| dqperchunk = libxfs_calc_dquots_per_chunk(dqchunklen); # 1162|-> dqid = 0; # 1163| qbno = NULLFILEOFF; # 1164| Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/dinode.c:2941:2: warning[deadcode.DeadStores]: Value stored to 'dino' is never read # 2939| ino_bpp) != 0) # 2940| goto bad_out; # 2941|-> dino = *dinop; # 2942| # 2943| /* Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/dir2.c:1122:2: warning[deadcode.DeadStores]: Value stored to 'buf_dirty' is never read # 1120| current_hashval = 0; # 1121| greatest_hashval = 0; # 1122|-> buf_dirty = 0; # 1123| # 1124| do { Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore.h:305:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/rmap.c: scope_hint: In function ‘record_inode_reflink_flag’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/linux.h:39: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:15: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/rmap.c:6: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/rmap.c:1173:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:30: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs_arch.h:138:31: note: in definition of macro ‘__swab64’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/rmap.c:1174:15: note: in expansion of macro ‘be64_to_cpu’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore.h:10: included_from: Included from here. # 303| get_inode_offset(struct xfs_mount *mp, xfs_ino_t ino, ino_tree_node_t *irec) # 304| { # 305|-> return XFS_INO_TO_AGINO(mp, ino) - irec->ino_startnum; # 306| } # 307| static inline ino_tree_node_t * Error: GCC_ANALYZER_WARNING (CWE-401): xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/linux.h:39: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:15: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c:7: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c: scope_hint: In function ‘add_bcnt_extent’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c:276:19: warning[-Wanalyzer-malloc-leak]: leak of ‘mk_extent_tree_nodes(startblock, blockcount, 2)’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c:276:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c:271:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c:272:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c:272:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c:276:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c:295:17: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ext.c:276:9: note: in expansion of macro ‘ASSERT’ # 274| ext = mk_extent_tree_nodes(startblock, blockcount, XR_E_FREE); # 275| # 276|-> ASSERT(ext->next == NULL); # 277| # 278| #ifdef XR_BCNT_TRACE Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/incore_ino.c:217:8: warning[unix.MallocSizeof]: Result of 'calloc' is converted to a pointer of type 'uint8_t', which is incompatible with sizeof operand type 'xfs_inofree_t' # 215| return NULL; # 216| # 217|-> ptr = calloc(XFS_INODES_PER_CHUNK, sizeof(*ptr)); # 218| if (!ptr) # 219| do_error(_("could not allocate ftypes array\n")); Error: GCC_ANALYZER_WARNING (CWE-401): xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c: scope_hint: In function ‘process_dir_inode’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c:322:22: warning[-Wanalyzer-malloc-leak]: leak of ‘dir_hash_init(*ip.i_disk_size)’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:17: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c:7: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c:3212:23: note: in expansion of macro ‘list_entry’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c:332:34: note: in expansion of macro ‘DIR_HASH_TAB_SIZE’ # 320| int hsize; # 321| # 322|-> hsize = size / 64; # 323| if (hsize < 16) # 324| hsize = 16; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c:2380:12: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from variable 'bp') # 2378| xfs_dir2_leaf_entry_t *blp; # 2379| # 2380|-> block = bp->b_addr; # 2381| btp = xfs_dir2_block_tail_p(mp->m_dir_geo, block); # 2382| blp = xfs_dir2_block_leaf_p(btp); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c: scope_hint: In function ‘longform_dir2_entry_check’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c:2380:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bp’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c:3212:23: note: in expansion of macro ‘list_entry’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/phase6.c:332:34: note: in expansion of macro ‘DIR_HASH_TAB_SIZE’ # 2378| xfs_dir2_leaf_entry_t *blp; # 2379| # 2380|-> block = bp->b_addr; # 2381| btp = xfs_dir2_block_tail_p(mp->m_dir_geo, block); # 2382| blp = xfs_dir2_block_leaf_p(btp); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/prefetch.c:758:11: warning[core.NullDereference]: Dereference of null pointer # 756| # 757| for (irec = findfirst_inode_rec(args->agno); irec != NULL; # 758|-> irec = next_ino_rec(irec)) { # 759| # 760| cur_irec = irec; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/progress.c:435:35: warning[deadcode.DeadStores]: Although the value stored to 'seconds' is used in the enclosing expression, the value is never actually read from 'seconds' # 433| # 434| *buf = '\0'; # 435|-> weeks = days = hours = minutes = seconds = sum = 0; # 436| if (length >= ONEWEEK) { # 437| weeks = length / ONEWEEK; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/rmap.c:853:12: warning[core.NullDereference]: Access to field 'rm_startblock' results in a dereference of a null pointer (loaded from variable 'array_cur') # 851| /* Set nbno to the bno of the next refcount change */ # 852| if (n < slab_count(rmaps)) # 853|-> nbno = array_cur->rm_startblock; # 854| else # 855| nbno = NULLAGBLOCK; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/rmap.c: scope_hint: In function ‘compute_refcounts’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/rmap.c:853:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘array_cur’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/rmap.c:807:17: note: in expansion of macro ‘ASSERT’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/rmap.c:835:25: note: in expansion of macro ‘ASSERT’ # 851| /* Set nbno to the bno of the next refcount change */ # 852| if (n < slab_count(rmaps)) # 853|-> nbno = array_cur->rm_startblock; # 854| else # 855| nbno = NULLAGBLOCK; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/scan.c:490:14: warning[deadcode.DeadStores]: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err' # 488| last_key = NULLFILEOFF; # 489| # 490|-> for (i = 0, err = 0; i < numrecs; i++) { # 491| /* # 492| * XXX - if we were going to fix up the interior btree nodes, Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/scan.c:610:3: warning[deadcode.DeadStores]: Value stored to 'name' is never read # 608| break; # 609| default: # 610|-> name = "(unknown)"; # 611| assert(0); # 612| break; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/scan.c:1026:3: warning[deadcode.DeadStores]: Value stored to 'name' is never read # 1024| # 1025| if (magic != XFS_RMAP_CRC_MAGIC) { # 1026|-> name = "(unknown)"; # 1027| hdr_errors++; # 1028| suspect++; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/scan.c:1371:3: warning[deadcode.DeadStores]: Value stored to 'name' is never read # 1369| # 1370| if (magic != XFS_REFC_CRC_MAGIC) { # 1371|-> name = "(unknown)"; # 1372| hdr_errors++; # 1373| suspect++; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/scan.c:1774:2: warning[deadcode.DeadStores]: Value stored to 'agbno' is never read # 1772| ino = be32_to_cpu(rp->ir_startino); # 1773| off = XFS_AGINO_TO_OFFSET(mp, ino); # 1774|-> agbno = XFS_AGINO_TO_AGBNO(mp, ino); # 1775| lino = XFS_AGINO_TO_INO(mp, agno, ino); # 1776| freecount = inorec_get_freecount(mp, rp); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/scan.c:1887:2: warning[deadcode.DeadStores]: Value stored to 'agbno' is never read # 1885| ino = be32_to_cpu(rp->ir_startino); # 1886| off = XFS_AGINO_TO_OFFSET(mp, ino); # 1887|-> agbno = XFS_AGINO_TO_AGBNO(mp, ino); # 1888| lino = XFS_AGINO_TO_INO(mp, agno, ino); # 1889| freecount = inorec_get_freecount(mp, rp); Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/scan.c:2105:3: warning[deadcode.DeadStores]: Value stored to 'name' is never read # 2103| break; # 2104| default: # 2105|-> name = "(unknown)"; # 2106| assert(0); # 2107| break; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/slab.c: scope_hint: In function ‘qsort_slab’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/slab.c:241:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘qs’ # 239| while (hdr) { # 240| qs = malloc(sizeof(struct qsort_slab)); # 241|-> qs->slab = slab; # 242| qs->hdr = hdr; # 243| qs->compare_fn = compare_fn; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/xfs_repair.c:590:13: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 588| do_warn(_("AG %u superblock contains plausible sb_unit value\n"), # 589| agno); # 590|-> new_sunit = sb.sb_unit; # 591| goto fix; # 592| } Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/repair/xfs_repair.c:1262:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'msgbuf' # 1260| # 1261| if (parse_sb_version(mp)) { # 1262|-> do_warn( # 1263| _("Found unsupported filesystem features. Exiting now.\n")); # 1264| return(1); Error: GCC_ANALYZER_WARNING (CWE-688): xfsprogs-6.8.0-build/xfsprogs-6.8.0/rtcp/xfs_rtcp.c: scope_hint: In function ‘rtcp’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/rtcp/xfs_rtcp.c:320:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fbuf’ where non-null expected xfsprogs-6.8.0-build/xfsprogs-6.8.0/rtcp/xfs_rtcp.c: scope_hint: In function ‘rtcp’ <built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null # 318| iosz = dioattr.d_miniosz; # 319| fbuf = memalign( dioattr.d_mem, iosz); # 320|-> memset(fbuf, 0, iosz); # 321| # 322| /* Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/scrub/inodes.c: scope_hint: In function ‘scan_ag_bulkstat’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/scrub/inodes.c:210:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘arg’ # 208| struct xfs_inumbers_req *ireq = ichunk_to_inumbers(ichunk); # 209| struct xfs_bulkstat_req *breq = ichunk_to_bulkstat(ichunk); # 210|-> struct scan_inodes *si = ichunk->si; # 211| struct xfs_bulkstat *bs; # 212| struct xfs_inumbers *inumbers = &ireq->inumbers[0]; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/scrub/inodes.c:274:6: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value # 272| # 273| err: # 274|-> if (error) { # 275| str_liberror(ctx, error, descr_render(&dsc_bulkstat)); # 276| si->aborted = true; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/scrub/phase5.c:233:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 231| break; # 232| } # 233|-> return ret; # 234| } # 235| #else Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/scrub/xfs_scrub.c:442:17: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 440| # 441| if (debug_tweak_on("XFS_SCRUB_PHASE")) # 442|-> debug_phase = atoi(getenv("XFS_SCRUB_PHASE")); # 443| # 444| /* Run all phases of the scrub tool. */ Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/scrub/xfs_scrub.c:769:4: warning[deadcode.DeadStores]: Value stored to 'mtab' is never read # 767| if (!mtab) { # 768| if (access(_PATH_PROC_MOUNTS, R_OK) == 0) # 769|-> mtab = _PATH_PROC_MOUNTS; # 770| else # 771| mtab = _PATH_MOUNTED; Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/scrub/xfs_scrub.c:771:4: warning[deadcode.DeadStores]: Value stored to 'mtab' is never read # 769| mtab = _PATH_PROC_MOUNTS; # 770| else # 771|-> mtab = _PATH_MOUNTED; # 772| } # 773| Error: GCC_ANALYZER_WARNING (CWE-688): xfsprogs-6.8.0-build/xfsprogs-6.8.0/spaceman/freesp.c: scope_hint: In function ‘histinit’ xfsprogs-6.8.0-build/xfsprogs-6.8.0/spaceman/freesp.c:105:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/platform_defs.h:15: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/include/libxfs.h:14: included_from: Included from here. xfsprogs-6.8.0-build/xfsprogs-6.8.0/spaceman/freesp.c:9: included_from: Included from here. /usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null # 103| if (!seen1) # 104| addhistent(1); # 105|-> qsort(hist, histcount, sizeof(*hist), hcmp); # 106| } # 107| for (i = 0; i < histcount; i++) { Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/spaceman/freesp.c:109:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 107| for (i = 0; i < histcount; i++) { # 108| if (i < histcount - 1) # 109|-> hist[i].high = hist[i + 1].low - 1; # 110| else # 111| hist[i].high = maxlen; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.8.0-build/xfsprogs-6.8.0/spaceman/freesp.c:111:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 109| hist[i].high = hist[i + 1].low - 1; # 110| else # 111|-> hist[i].high = maxlen; # 112| } # 113| } Error: CLANG_WARNING: xfsprogs-6.8.0-build/xfsprogs-6.8.0/spaceman/health.c:347:4: warning[deadcode.DeadStores]: Value stored to 'x' is never read # 345| default_report = false; # 346| errno = 0; # 347|-> x = strtoll(optarg, NULL, 10); # 348| if (errno) { # 349| perror("inode health");