Task #182 - xfsprogs-6.7.0-1.fc41/scan-results.err
back to task #182download
Error: SHELLCHECK_WARNING: /usr/sbin/fsck.xfs:37:2: warning[SC2220]: Invalid flags are not handled. Add a *) case. # 35| while getopts ":aApyf" c # 36| do # 37|-> case $c in # 38| a|A|p) AUTO=true;; # 39| y) REPAIR=true;; Error: SHELLCHECK_WARNING (CWE-569): /usr/sbin/fsck.xfs:43:12: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it. # 41| esac # 42| done # 43|-> eval DEV=\${$#} # 44| if [ ! -e $DEV ]; then # 45| echo "$0: $DEV does not exist" Error: SHELLCHECK_WARNING (CWE-569): /usr/sbin/fsck.xfs:43:15: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it. # 41| esac # 42| done # 43|-> eval DEV=\${$#} # 44| if [ ! -e $DEV ]; then # 45| echo "$0: $DEV does not exist" Error: SHELLCHECK_WARNING (CWE-477): /usr/sbin/fsck.xfs:63:16: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 61| *i*) FORCE=false ;; # 62| esac # 63|-> if [ -n "$PS1" -o -t 0 ]; then # 64| FORCE=false # 65| fi Error: SHELLCHECK_WARNING (CWE-156): /usr/sbin/fsck.xfs:84:8: warning[SC2046]: Quote this to prevent word splitting. # 82| done # 83| test -b "$ROOT" || ROOT=$(blkid -t "$ROOT" -o device) # 84|-> if [ $(basename $DEV) = $(basename $ROOT) ]; then # 85| mount $DEV /tmp/repair_mnt $ROOTFLAGS || exit 1 # 86| else Error: SHELLCHECK_WARNING (CWE-156): /usr/sbin/fsck.xfs:84:27: warning[SC2046]: Quote this to prevent word splitting. # 82| done # 83| test -b "$ROOT" || ROOT=$(blkid -t "$ROOT" -o device) # 84|-> if [ $(basename $DEV) = $(basename $ROOT) ]; then # 85| mount $DEV /tmp/repair_mnt $ROOTFLAGS || exit 1 # 86| else Error: SHELLCHECK_WARNING (CWE-149): /usr/sbin/xfs_admin:35:34: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them. # 33| IO_OPTS=$IO_OPTS" -r -c label" # 34| ;; # 35|-> L) DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'" # 36| IO_OPTS=$IO_OPTS" -c 'label -s "$OPTARG"'" # 37| ;; Error: SHELLCHECK_WARNING (CWE-149): /usr/sbin/xfs_admin:36:35: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them. # 34| ;; # 35| L) DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'" # 36|-> IO_OPTS=$IO_OPTS" -c 'label -s "$OPTARG"'" # 37| ;; # 38| O) REPAIR_OPTS=$REPAIR_OPTS" -c $OPTARG" Error: SHELLCHECK_WARNING (CWE-149): /usr/sbin/xfs_admin:50:33: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them. # 48| IO_OPTS=$IO_OPTS" -r -c fsuuid" # 49| ;; # 50|-> U) DB_OPTS=$DB_OPTS" -c 'uuid "$OPTARG"'" # 51| require_offline=1 # 52| ;; Error: SHELLCHECK_WARNING (CWE-88): /usr/sbin/xfs_admin:62:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 60| esac # 61| done # 62|-> set -- extra $@ # 63| shift $OPTIND # 64| case $# in Error: SHELLCHECK_WARNING (CWE-156): /usr/sbin/xfs_bmap:29:7: warning[SC2046]: Quote this to prevent word splitting. # 27| $VERSION && $DIRNAME/xfs_io -p xfs_bmap -V # 28| # 29|-> shift `expr $OPTIND - 1` # 30| # 31| while [ "$1" != "" ] Error: SHELLCHECK_WARNING (CWE-563): /usr/sbin/xfs_freeze:6:1: warning[SC2034]: OPTS appears unused. Verify use (or export if used externally). # 4| # # 5| # 6|-> OPTS="" # 7| USAGE="Usage: xfs_freeze [-V] [-f | -u] <mountpoint>" # 8| DIRNAME=`dirname $0` Error: SHELLCHECK_WARNING (CWE-156): /usr/sbin/xfs_freeze:29:7: warning[SC2046]: Quote this to prevent word splitting. # 27| fi # 28| # 29|-> shift `expr $OPTIND - 1` # 30| if [ "$1" = "" ]; then # 31| echo $USAGE 1>&2 Error: SHELLCHECK_WARNING: /usr/sbin/xfs_info:14:2: warning[SC3043]: In POSIX sh, 'local' is undefined. # 12| # the last line and return it if it's actually a block device. # 13| try_find_loop_dev_for_file() { # 14|-> local x="$(losetup -O NAME -j "$1" 2> /dev/null | tail -n 1)" # 15| test -b "$x" && echo "$x" # 16| } Error: SHELLCHECK_WARNING (CWE-571): /usr/sbin/xfs_info:14:8: warning[SC2155]: Declare and assign separately to avoid masking return values. # 12| # the last line and return it if it's actually a block device. # 13| try_find_loop_dev_for_file() { # 14|-> local x="$(losetup -O NAME -j "$1" 2> /dev/null | tail -n 1)" # 15| test -b "$x" && echo "$x" # 16| } Error: SHELLCHECK_WARNING (CWE-149): /usr/sbin/xfs_metadump:17:20: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them. # 15| e) OPTS=$OPTS"-e ";; # 16| g) OPTS=$OPTS"-g ";; # 17|-> m) OPTS=$OPTS"-m "$OPTARG" ";; # 18| o) OPTS=$OPTS"-o ";; # 19| w) OPTS=$OPTS"-w ";; Error: SHELLCHECK_WARNING (CWE-149): /usr/sbin/xfs_metadump:21:25: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them. # 19| w) OPTS=$OPTS"-w ";; # 20| f) DBOPTS=$DBOPTS" -f";; # 21|-> l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; # 22| F) DBOPTS=$DBOPTS" -F";; # 23| v) OPTS=$OPTS"-v "$OPTARG" ";; Error: SHELLCHECK_WARNING (CWE-149): /usr/sbin/xfs_metadump:23:20: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them. # 21| l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; # 22| F) DBOPTS=$DBOPTS" -F";; # 23|-> v) OPTS=$OPTS"-v "$OPTARG" ";; # 24| V) xfs_db -p xfs_metadump -V # 25| status=$? Error: SHELLCHECK_WARNING (CWE-88): /usr/sbin/xfs_metadump:33:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 31| esac # 32| done # 33|-> set -- extra $@ # 34| shift $OPTIND # 35| case $# in Error: SHELLCHECK_WARNING (CWE-563): /usr/sbin/xfs_mkfile:6:1: warning[SC2034]: OPTS appears unused. Verify use (or export if used externally). # 4| # # 5| # 6|-> OPTS="" # 7| NOBYTES=false # 8| PREALLOC=false Error: SHELLCHECK_WARNING (CWE-156): /usr/sbin/xfs_mkfile:28:7: warning[SC2046]: Quote this to prevent word splitting. # 26| $VERSION && $XFS_IO -V # 27| # 28|-> shift `expr $OPTIND - 1` # 29| [ "$1" != "" ] || exit 0 # 30| SIZE="$1" Error: SHELLCHECK_WARNING: /usr/sbin/xfs_ncheck:14:2: warning[SC2213]: getopts specified -b, but it's not handled by this 'case'. # 12| while getopts "b:fi:l:svV" c # 13| do # 14|-> case $c in # 15| s) OPTS=$OPTS"-s ";; # 16| i) OPTS=$OPTS"-i "$OPTARG" ";; Error: SHELLCHECK_WARNING (CWE-149): /usr/sbin/xfs_ncheck:16:20: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them. # 14| case $c in # 15| s) OPTS=$OPTS"-s ";; # 16|-> i) OPTS=$OPTS"-i "$OPTARG" ";; # 17| v) OPTS=$OPTS"-v ";; # 18| f) DBOPTS=$DBOPTS" -f";; Error: SHELLCHECK_WARNING (CWE-149): /usr/sbin/xfs_ncheck:19:25: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them. # 17| v) OPTS=$OPTS"-v ";; # 18| f) DBOPTS=$DBOPTS" -f";; # 19|-> l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; # 20| V) xfs_db -p xfs_ncheck -V # 21| status=$? Error: SHELLCHECK_WARNING (CWE-88): /usr/sbin/xfs_ncheck:29:14: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 27| esac # 28| done # 29|-> set -- extra $@ # 30| shift $OPTIND # 31| case $# in Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/db/btblock.c:168:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.7.0/include/linux.h:39: included_from: Included from here. xfsprogs-6.7.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.7.0/include/libxfs.h:12: included_from: Included from here. xfsprogs-6.7.0/db/btblock.c:7: included_from: Included from here. xfsprogs-6.7.0/db/btblock.c: scope_hint: In function ‘btblock_ptr_offset’ xfsprogs-6.7.0/db/btblock.c:244:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/db/btblock.c:245:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.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.7.0/db/btblock.c: scope_hint: In function ‘btblock_key_offset’ xfsprogs-6.7.0/db/btblock.c:226:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.7.0/db/btblock.c:223:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/db/btblock.c:224:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.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.7.0/db/btblock.c: scope_hint: In function ‘btblock_rec_offset’ xfsprogs-6.7.0/db/btblock.c:271:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.7.0/db/btblock.c:268:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/db/btblock.c:269:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.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.7.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.7.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.7.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.7.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.7.0/db/namei.c: scope_hint: In function ‘path_parse’ xfsprogs-6.7.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.7.0/db/namei.c: scope_hint: In function ‘path_navigate’ xfsprogs-6.7.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.7.0/db/namei.c: scope_hint: In function ‘dir_emit’ xfsprogs-6.7.0/db/namei.c:270:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘display_name’ where non-null expected xfsprogs-6.7.0/include/linux.h:18: included_from: Included from here. xfsprogs-6.7.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.7.0/include/libxfs.h:12: included_from: Included from here. xfsprogs-6.7.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.7.0/db/write.c: scope_hint: In function ‘write_string’ xfsprogs-6.7.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.7.0/fsr/xfs_fsr.c:1163:19: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 1161| nextents = read_fd_bmap(fd, statp, &cur_nextents); # 1162| # 1163|-> if (cur_nextents == 1 || cur_nextents <= nextents) { # 1164| if (vflag) # 1165| fsrprintf(_("%s already fully defragmented.\n"), fname); Error: GCC_ANALYZER_WARNING (CWE-457): xfsprogs-6.7.0/fsr/xfs_fsr.c: scope_hint: In function ‘packfile’ xfsprogs-6.7.0/fsr/xfs_fsr.c:1163:26: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cur_nextents’ # 1161| nextents = read_fd_bmap(fd, statp, &cur_nextents); # 1162| # 1163|-> if (cur_nextents == 1 || cur_nextents <= nextents) { # 1164| if (vflag) # 1165| fsrprintf(_("%s already fully defragmented.\n"), fname); Error: CLANG_WARNING: xfsprogs-6.7.0/fsr/xfs_fsr.c:1374:11: warning[deadcode.DeadStores]: Although the value stored to 'wc' is used in the enclosing expression, the value is never actually read from 'wc' # 1372| /* Do a matching write to the tmp file */ # 1373| wc_b4 = wc; # 1374|-> if (((wc = write(ffd, fbuf, wc)) != wc_b4)) { # 1375| fsrprintf(_("bad write of %d bytes " # 1376| "to %s: %s\n"), Error: CLANG_WARNING: xfsprogs-6.7.0/scrub/repair.c:11: included_from: Included from here. xfsprogs-6.7.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.7.0/libxfs/xfs_defer.c:6: included_from: Included from here. xfsprogs-6.7.0/libxfs/libxfs_priv.h:46: included_from: Included from here. xfsprogs-6.7.0/include/list.h:112:13: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer (loaded from variable 'next') # 110| # 111| last->next = next; # 112|-> next->prev = last; # 113| } # 114| Error: CLANG_WARNING: xfsprogs-6.7.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.7.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.7.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.7.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.7.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.7.0/io/mmap.c: scope_hint: In function ‘print_mapping’ xfsprogs-6.7.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.7.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.7.0/io/parent.c: scope_hint: In function ‘check_parent_entry’ xfsprogs-6.7.0/io/parent.c:88:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parent’ xfsprogs-6.7.0/io/parent.c: scope_hint: In function ‘check_parent_entry’ xfsprogs-6.7.0/include/platform_defs.h:10: included_from: Included from here. xfsprogs-6.7.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.7.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.7.0/io/parent.c: scope_hint: In function ‘parent_check’ xfsprogs-6.7.0/io/parent.c:263:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘parentbuf’ xfsprogs-6.7.0/io/parent.c: scope_hint: In function ‘parent_check’ xfsprogs-6.7.0/include/platform_defs.h:35: included_from: Included from here. xfsprogs-6.7.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: CLANG_WARNING: xfsprogs-6.7.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.7.0/libfrog/bitmap.c: scope_hint: In function '__bitmap_set' xfsprogs-6.7.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.7.0/include/platform_defs.h:26: included_from: Included from here. xfsprogs-6.7.0/libfrog/bitmap.c:11: included_from: Included from here. xfsprogs-6.7.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.7.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.7.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.7.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.7.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.7.0/libfrog/bitmap.c: scope_hint: In function 'bitmap_iterate_range' xfsprogs-6.7.0/libfrog/bitmap.c:370:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'pos' xfsprogs-6.7.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.7.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.7.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.7.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: CLANG_WARNING: xfsprogs-6.7.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.7.0/libfrog/list_sort.c: scope_hint: In function 'merge_and_restore_back_links' xfsprogs-6.7.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.7.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.7.0/libfrog/radix-tree.c: scope_hint: In function 'radix_tree_gang_lookup' xfsprogs-6.7.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.7.0/libfrog/radix-tree.c: scope_hint: In function 'radix_tree_gang_lookup_ex' xfsprogs-6.7.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.7.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: CLANG_WARNING: xfsprogs-6.7.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.7.0/libxcmd/input.c: scope_hint: In function 'breakline' xfsprogs-6.7.0/libxcmd/input.c:108:16: warning[-Wanalyzer-malloc-leak]: leak of 'rval' # 106| } # 107| *count = c; # 108|-> return rval; # 109| } # 110| Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_btree.c:6: included_from: Included from here. xfsprogs-6.7.0/libxfs/libxfs_priv.h:91: included_from: Included from here. xfsprogs-6.7.0/libxfs/libxfs_io.h:121:9: warning[core.NullDereference]: Access to field 'b_maps' results in a dereference of a null pointer (loaded from variable 'bp') # 119| static inline xfs_daddr_t xfs_buf_daddr(struct xfs_buf *bp) # 120| { # 121|-> return bp->b_maps[0].bm_bn; # 122| } # 123| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/libxfs_io.h:121:18: warning[-Wanalyzer-null-dereference]: dereference of NULL 'bp' xfsprogs-6.7.0/libxfs/xfs_btree.c: scope_hint: In function 'xfs_btree_visit_block' xfsprogs-6.7.0/libxfs/xfs_btree.c: scope_hint: In function 'xfs_btree_visit_block' xfsprogs-6.7.0/libxfs/libxfs_priv.h:59: included_from: Included from here. xfsprogs-6.7.0/include/xfs_arch.h:134:31: note: in definition of macro '__swab32' xfsprogs-6.7.0/libxfs/xfs_btree.c:4372:21: note: in expansion of macro 'be32_to_cpu' xfsprogs-6.7.0/libxfs/xfs_btree.c:9: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_BB_TO_FSBT' xfsprogs-6.7.0/libxfs/xfs_btree.c:4372:44: note: in expansion of macro 'xfs_daddr_to_agbno' xfsprogs-6.7.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_BB_TO_FSBT' xfsprogs-6.7.0/libxfs/xfs_btree.c:4372:44: note: in expansion of macro 'xfs_daddr_to_agbno' # 119| static inline xfs_daddr_t xfs_buf_daddr(struct xfs_buf *bp) # 120| { # 121|-> return bp->b_maps[0].bm_bn; # 122| } # 123| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_ag_resv.c: scope_hint: In function '__xfs_ag_resv_free' xfsprogs-6.7.0/libxfs/xfs_ag_resv.c:141:56: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.7.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.7.0/libxfs/xfs_ag_resv.c:150:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.7.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.7.0/libxfs/xfs_alloc.c:326:9: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 324| # 325| /* Trim busy sections out of found extent */ # 326|-> busy = xfs_extent_busy_trim(args, &bno, &len, busy_gen); # 327| # 328| /* Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_alloc.c:1029:16: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 1027| return error; # 1028| ASSERT(len >= acur->cur_len); # 1029|-> acur->cur_len = len; # 1030| # 1031| /* Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_alloc.c:1229:2: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 1227| tbno = fbno; # 1228| tlen = flen; # 1229|-> xfs_extent_busy_trim(args, &tbno, &tlen, &busy_gen); # 1230| # 1231| /* Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_alloc.c:3821:3: warning[deadcode.DeadStores]: Value stored to 'busy_flags' is never read # 3819| # 3820| if (skip_discard) # 3821|-> busy_flags |= XFS_EXTENT_BUSY_SKIP_DISCARD; # 3822| xfs_extent_busy_insert(tp, pag, agbno, len, busy_flags); # 3823| return 0; Error: CLANG_WARNING: xfsprogs-6.7.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.7.0/libxfs/xfs_attr.c:1500:2: warning[deadcode.DeadStores]: Value stored to 'error' is never read # 1498| goto out; # 1499| # 1500|-> error = xfs_attr_node_removename(args, state); # 1501| # 1502| /* Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_attr_leaf.c:984:3: warning[deadcode.DeadStores]: Value stored to 'error' is never read # 982| sfe->namelen); # 983| nargs.attr_filter = sfe->flags & XFS_ATTR_NSP_ONDISK_MASK; # 984|-> error = xfs_attr3_leaf_lookup_int(bp, &nargs); /* set a->index */ # 985| ASSERT(error == -ENOATTR); # 986| error = xfs_attr3_leaf_add(bp, &nargs); Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_attr_leaf.c:2649:4: warning[deadcode.DeadStores]: Value stored to 'tmp' is never read # 2647| ichdr_s->count -= 1; # 2648| ichdr_d->count += 1; # 2649|-> tmp = ichdr_d->count * sizeof(xfs_attr_leaf_entry_t) # 2650| + xfs_attr3_leaf_hdr_size(leaf_d); # 2651| ASSERT(ichdr_d->firstused >= tmp); Error: GCC_ANALYZER_WARNING (CWE-126): xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:10: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_attr_remote.c: scope_hint: In function 'xfs_attr_rmtval_get' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:61: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:61: note: read of 8 bytes from after the end of 'map' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:61: note: valid subscripts for 'map' are '[0]' to '[0]' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.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.7.0/libxfs/xfs_attr_remote.c:417:59: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:417:59: note: read of 8 bytes from after the end of 'map' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:417:59: note: valid subscripts for 'map' are '[0]' to '[0]' xfsprogs-6.7.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.7.0/libxfs/xfs_attr_remote.c:431:41: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:451:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.7.0/libxfs/xfs_format.h:440:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_format.h:441:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:416:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.7.0/libxfs/xfs_attr_remote.c:431:41: note: read of 8 bytes from after the end of 'map' xfsprogs-6.7.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.7.0/libxfs/xfs_bmap.c: scope_hint: In function 'xfs_bmap_btree_to_extents' xfsprogs-6.7.0/libxfs/xfs_bmap.c:537:34: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.7.0/libxfs/xfs_bmap.c: scope_hint: In function 'xfs_bmap_btree_to_extents' xfsprogs-6.7.0/libxfs/libxfs_priv.h:196:34: note: in definition of macro 'unlikely' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5650:13: note: in expansion of macro 'XFS_IS_CORRUPT' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5650:13: note: in expansion of macro 'XFS_IS_CORRUPT' xfsprogs-6.7.0/libxfs/libxfs_priv.h:196:34: note: in definition of macro 'unlikely' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5656:13: note: in expansion of macro 'XFS_IS_CORRUPT' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5656:13: note: in expansion of macro 'XFS_IS_CORRUPT' xfsprogs-6.7.0/libxfs/xfs_bmap.c: scope_hint: In function 'xfs_bmap_btree_to_extents' xfsprogs-6.7.0/libxfs/libxfs_priv.h:196:34: note: in definition of macro 'unlikely' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5663:13: note: in expansion of macro 'XFS_IS_CORRUPT' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5663:13: note: in expansion of macro 'XFS_IS_CORRUPT' # 535| struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); # 536| struct xfs_mount *mp = ip->i_mount; # 537|-> struct xfs_btree_block *rblock = ifp->if_broot; # 538| struct xfs_btree_block *cblock;/* child btree block */ # 539| xfs_fsblock_t cbno; /* child block number */ Error: GCC_ANALYZER_WARNING (CWE-457): xfsprogs-6.7.0/libxfs/xfs_bmap.c: scope_hint: In function '__xfs_bunmapi' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5490:34: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'tmp_logflags' xfsprogs-6.7.0/libxfs/xfs_bmap.c: scope_hint: In function '__xfs_bunmapi' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5279:13: note: in expansion of macro 'XFS_IS_CORRUPT' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5288:17: note: in expansion of macro 'xfs_iread_extents' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5288:17: note: in expansion of macro 'xfs_iread_extents' xfsprogs-6.7.0/libxfs/xfs_bmap.c:1172:1: note: in expansion of macro 'xfs_iread_extents' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5288:17: note: in expansion of macro 'xfs_iread_extents' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5297:48: note: in expansion of macro 'XFS_IS_REALTIME_INODE' xfsprogs-6.7.0/libxfs/xfs_bmap.c: scope_hint: In function '__xfs_bunmapi' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5044:33: note: in expansion of macro 'XFS_IFORK_MAXEXT' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5044:33: note: in expansion of macro 'XFS_IFORK_MAXEXT' # 5488| &del, &tmp_logflags, whichfork, # 5489| flags); # 5490|-> logflags |= tmp_logflags; # 5491| } # 5492| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_bmap.c: scope_hint: In function 'xfs_bmse_merge' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5639:12: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 5637| * inode. # 5638| */ # 5639|-> ifp->if_nextents--; # 5640| *logflags |= XFS_ILOG_CORE; # 5641| if (!cur) { Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_bmap_btree.c: scope_hint: In function 'xfs_bmbt_get_minrecs.part.0' xfsprogs-6.7.0/libxfs/xfs_bmap_btree.c:295:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 293| # 294| return xfs_bmbt_maxrecs(cur->bc_mp, # 295|-> ifp->if_broot_bytes, level == 0) / 2; # 296| } # 297| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_bmap_btree.c: scope_hint: In function 'xfs_bmbt_get_maxrecs.part.0' xfsprogs-6.7.0/libxfs/xfs_bmap_btree.c:313:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 311| # 312| return xfs_bmbt_maxrecs(cur->bc_mp, # 313|-> ifp->if_broot_bytes, level == 0); # 314| } # 315| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/libxfs_priv.h:59: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_bmap_btree.c:6: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_bmap_btree.c: scope_hint: In function 'xfs_bmbt_init_cursor' xfsprogs-6.7.0/libxfs/xfs_bmap_btree.c:560:42: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.7.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.7.0/libxfs/xfs_bmap_btree.c:560:27: note: in expansion of macro 'be16_to_cpu' xfsprogs-6.7.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.7.0/libxfs/xfs_bmap_btree.c:560:27: note: in expansion of macro 'be16_to_cpu' # 558| cur = xfs_btree_alloc_cursor(mp, tp, XFS_BTNUM_BMAP, # 559| mp->m_bm_maxlevels[whichfork], xfs_bmbt_cur_cache); # 560|-> cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; # 561| cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_bmbt_2); # 562| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_btree.c:737:16: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.7.0/libxfs/xfs_btree.c: scope_hint: In function 'xfs_btree_get_block.part.0' xfsprogs-6.7.0/libxfs/xfs_btree.c: scope_hint: In function 'xfs_btree_get_block.part.0' # 735| struct xfs_ifork *ifp = xfs_btree_ifork_ptr(cur); # 736| # 737|-> return (struct xfs_btree_block *)ifp->if_broot; # 738| } # 739| Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_btree.c:16: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_btree.h:486:9: warning[core.NullDereference]: Access to field 'bb_numrecs' results in a dereference of a null pointer (loaded from variable 'block') # 484| static inline int xfs_btree_get_numrecs(const struct xfs_btree_block *block) # 485| { # 486|-> return be16_to_cpu(block->bb_numrecs); # 487| } # 488| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_btree.h:486:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'block' xfsprogs-6.7.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.7.0/libxfs/xfs_btree.h:486:16: note: in expansion of macro 'be16_to_cpu' xfsprogs-6.7.0/libxfs/xfs_btree.c: scope_hint: In function 'xfs_btree_lookup' xfsprogs-6.7.0/libxfs/xfs_btree.c:1892:13: note: in expansion of macro 'XFS_IS_CORRUPT' xfsprogs-6.7.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.7.0/libxfs/xfs_btree.h:486:16: note: in expansion of macro 'be16_to_cpu' # 484| static inline int xfs_btree_get_numrecs(const struct xfs_btree_block *block) # 485| { # 486|-> return be16_to_cpu(block->bb_numrecs); # 487| } # 488| Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_da_btree.c:449:12: warning[core.NullDereference]: Access to field 'b_ops' results in a dereference of a null pointer (loaded from variable 'bp') # 447| if (error) # 448| return error; # 449|-> bp->b_ops = &xfs_da3_node_buf_ops; # 450| xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF); # 451| node = bp->b_addr; Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_da_btree.c:679:9: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from variable 'bp') # 677| if (error) # 678| return error; # 679|-> node = bp->b_addr; # 680| oldroot = blk1->bp->b_addr; # 681| if (oldroot->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC) || Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_da_btree.c:1622:10: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from field 'bp') # 1620| return error; # 1621| } # 1622|-> curr = blk->bp->b_addr; # 1623| magic = be16_to_cpu(curr->magic); # 1624| Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_da_btree.c:2048:10: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from field 'bp') # 2046| blk->bp = bp; # 2047| # 2048|-> info = blk->bp->b_addr; # 2049| ASSERT(info->magic == cpu_to_be16(XFS_DA_NODE_MAGIC) || # 2050| info->magic == cpu_to_be16(XFS_DA3_NODE_MAGIC) || Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_da_btree.c:2214:22: warning[core.NullDereference]: Dereference of null pointer # 2212| for (i = 0, got = 0; i < mapi; i++) # 2213| got += mapp[i].br_blockcount; # 2214|-> if (got != count || mapp[0].br_startoff != *bno || # 2215| mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount != # 2216| *bno + count) { Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_da_btree.c: scope_hint: In function 'xfs_da_grow_inode_int' xfsprogs-6.7.0/libxfs/xfs_da_btree.c:2214:36: warning[-Wanalyzer-null-dereference]: dereference of NULL 'mapp' # 2212| for (i = 0, got = 0; i < mapi; i++) # 2213| got += mapp[i].br_blockcount; # 2214|-> if (got != count || mapp[0].br_startoff != *bno || # 2215| mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount != # 2216| *bno + count) { Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_defer.c:471:40: warning[core.uninitialized.ArraySubscript]: Array subscript is undefined # 469| struct xfs_defer_pending *dfp) # 470| { # 471|-> const struct xfs_defer_op_type *ops = defer_op_types[dfp->dfp_type]; # 472| struct xfs_btree_cur *state = NULL; # 473| struct list_head *li, *n; Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_defer.c:511:3: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value # 509| out: # 510| if (ops->finish_cleanup) # 511|-> ops->finish_cleanup(tp, state, error); # 512| return error; # 513| } Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_defer.c:512:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 510| if (ops->finish_cleanup) # 511| ops->finish_cleanup(tp, state, error); # 512|-> return error; # 513| } # 514| Error: CLANG_WARNING: xfsprogs-6.7.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.7.0/libxfs/xfs_dir2_block.c: scope_hint: In function 'xfs_dir2_sf_to_block' xfsprogs-6.7.0/libxfs/xfs_dir2_block.c:1236:36: warning[-Wanalyzer-null-dereference]: dereference of NULL 'sfep' # 1234| dep = bp->b_addr + newoffset; # 1235| dep->inumber = cpu_to_be64(xfs_dir2_sf_get_ino(mp, sfp, sfep)); # 1236|-> dep->namelen = sfep->namelen; # 1237| xfs_dir2_data_put_ftype(mp, dep, # 1238| xfs_dir2_sf_get_ftype(mp, sfep)); Error: CLANG_WARNING: xfsprogs-6.7.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.7.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.7.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.7.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.7.0/libxfs/xfs_dir2_leaf.c: scope_hint: In function 'xfs_dir2_leaf_lookup_int' xfsprogs-6.7.0/libxfs/xfs_dir2_leaf.c:1288:60: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbp' xfsprogs-6.7.0/libxfs/libxfs_priv.h:59: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_dir2_leaf.c:7: included_from: Included from here. xfsprogs-6.7.0/include/xfs_arch.h:134:31: note: in definition of macro '__swab32' xfsprogs-6.7.0/libxfs/xfs_dir2_leaf.c:1257:25: note: in expansion of macro 'be32_to_cpu' xfsprogs-6.7.0/include/xfs_arch.h:134:31: note: in definition of macro '__swab32' xfsprogs-6.7.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.7.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.7.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.7.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.7.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.7.0/libxfs/xfs_ialloc.c:1135:23: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 1133| xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); # 1134| # 1135|-> pag->pagl_leftrec = trec.ir_startino; # 1136| pag->pagl_rightrec = rec.ir_startino; # 1137| pag->pagl_pagino = pagino; Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_ialloc.c:1242:18: warning[core.BitwiseShift]: Right operand is negative in left shift # 1240| XFS_INODES_PER_CHUNK) == 0); # 1241| ino = XFS_AGINO_TO_INO(mp, pag->pag_agno, rec.ir_startino + offset); # 1242|-> rec.ir_free &= ~XFS_INOBT_MASK(offset); # 1243| rec.ir_freecount--; # 1244| error = xfs_inobt_update(cur, &rec); Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_ialloc.c:1504:18: warning[core.BitwiseShift]: Right operand is negative in left shift # 1502| * Modify or remove the finobt record. # 1503| */ # 1504|-> rec.ir_free &= ~XFS_INOBT_MASK(offset); # 1505| rec.ir_freecount--; # 1506| if (rec.ir_freecount) Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_ialloc.c:2668:24: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>' is a garbage value # 2666| if (error) # 2667| return error; # 2668|-> if (irec.ir_startino > high) # 2669| break; # 2670| Error: CLANG_WARNING: xfsprogs-6.7.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.7.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.7.0/libxfs/xfs_iext_tree.c:661:24: warning[core.NullDereference]: Array access (via field 'recs') results in a null pointer dereference # 659| # 660| for (i = nr_entries; i > cur->pos; i--) # 661|-> cur->leaf->recs[i] = cur->leaf->recs[i - 1]; # 662| xfs_iext_set(cur_rec(cur), irec); # 663| ifp->if_bytes += sizeof(struct xfs_iext_rec); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'libxfs_init_local_fork' xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:59:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 57| } # 58| # 59|-> ifp->if_bytes = size; # 60| } # 61| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iformat_extents' xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:125:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 123| } # 124| # 125|-> ifp->if_bytes = 0; # 126| ifp->if_u1.if_root = NULL; # 127| ifp->if_height = 0; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:7: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iformat_btree' xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:188:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.7.0/libxfs/libxfs_priv.h:196:34: note: in definition of macro 'unlikely' xfsprogs-6.7.0/libxfs/libxfs_priv.h:196:34: note: in definition of macro 'unlikely' # 186| * blocks. # 187| */ # 188|-> if (unlikely(ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork) || # 189| nrecs == 0 || # 190| XFS_BMDR_SPACE_CALC(nrecs) > Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iroot_realloc' xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:396:24: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 394| * allocate it now and get out. # 395| */ # 396|-> if (ifp->if_broot_bytes == 0) { # 397| new_size = XFS_BMAP_BROOT_SPACE_CALC(mp, rec_diff); # 398| ifp->if_broot = kmem_alloc(new_size, KM_NOFS); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:431:43: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 429| */ # 430| ASSERT((ifp->if_broot != NULL) && (ifp->if_broot_bytes > 0)); # 431|-> cur_max = xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, 0); # 432| new_max = cur_max + rec_diff; # 433| ASSERT(new_max >= 0); Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:458:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 456| op = (char *)XFS_BMBT_REC_ADDR(mp, ifp->if_broot, 1); # 457| np = (char *)XFS_BMBT_REC_ADDR(mp, new_broot, 1); # 458|-> memcpy(np, op, new_max * (uint)sizeof(xfs_bmbt_rec_t)); # 459| # 460| /* Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'libxfs_idata_realloc' xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:501:47: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 499| { # 500| struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); # 501|-> int64_t new_size = ifp->if_bytes + byte_diff; # 502| # 503| ASSERT(new_size >= 0); Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:624:24: warning[core.UndefinedBinaryOperatorResult]: The right operand of '&' is a garbage value due to array index out of bounds # 622| switch (ifp->if_format) { # 623| case XFS_DINODE_FMT_LOCAL: # 624|-> if ((iip->ili_fields & dataflag[whichfork]) && # 625| (ifp->if_bytes > 0)) { # 626| ASSERT(ifp->if_u1.if_data != NULL); Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:633:24: warning[core.UndefinedBinaryOperatorResult]: The right operand of '&' is a garbage value due to array index out of bounds # 631| # 632| case XFS_DINODE_FMT_EXTENTS: # 633|-> if ((iip->ili_fields & extflag[whichfork]) && # 634| (ifp->if_bytes > 0)) { # 635| ASSERT(ifp->if_nextents > 0); Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:642:24: warning[core.UndefinedBinaryOperatorResult]: The right operand of '&' is a garbage value due to array index out of bounds # 640| # 641| case XFS_DINODE_FMT_BTREE: # 642|-> if ((iip->ili_fields & brootflag[whichfork]) && # 643| (ifp->if_broot_bytes > 0)) { # 644| ASSERT(ifp->if_broot != NULL); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iext_count_may_overflow' xfsprogs-6.7.0/libxfs/xfs_inode_fork.c:763:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.7.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iext_count_may_overflow' # 761| max_exts = 10; # 762| # 763|-> nr_exts = ifp->if_nextents + nr_to_add; # 764| if (nr_exts < ifp->if_nextents || nr_exts > max_exts) # 765| return -EFBIG; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/libxfs/xfs_inode_fork.h:86:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.7.0/libxfs/libxfs_priv.h:42: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_bmap.c:6: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_bmap.c: scope_hint: In function '__xfs_bunmapi' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5556:1: note: in expansion of macro 'xfs_bunmapi' xfsprogs-6.7.0/libxfs/libxfs_priv.h:196:34: note: in definition of macro 'unlikely' xfsprogs-6.7.0/libxfs/xfs_bmap.c:5279:13: note: in expansion of macro 'XFS_IS_CORRUPT' # 84| static inline bool xfs_ifork_has_extents(struct xfs_ifork *ifp) # 85| { # 86|-> return ifp->if_format == XFS_DINODE_FMT_EXTENTS || # 87| ifp->if_format == XFS_DINODE_FMT_BTREE; # 88| } Error: CLANG_WARNING: xfsprogs-6.7.0/libxfs/xfs_refcount.c:2004:2: warning[unix.Malloc]: Use of memory after it is freed # 2002| out_free: # 2003| /* Free the leftover list */ # 2004|-> list_for_each_entry_safe(rr, n, &debris, rr_list) { # 2005| list_del(&rr->rr_list); # 2006| kfree(rr); Error: CLANG_WARNING: xfsprogs-6.7.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.7.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.7.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.7.0/logprint/log_misc.c: scope_hint: In function ‘xlog_print_add_to_trans’ xfsprogs-6.7.0/logprint/log_misc.c:144:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘item’ xfsprogs-6.7.0/logprint/log_misc.c:804:39: note: in definition of macro ‘BBTOOFF64’ xfsprogs-6.7.0/include/xfs.h:46: included_from: Included from here. xfsprogs-6.7.0/include/libxfs.h:12: included_from: Included from here. xfsprogs-6.7.0/logprint/log_misc.c:6: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_fs.h:854:27: note: in definition of macro ‘BBTOB’ xfsprogs-6.7.0/logprint/log_misc.c:853:28: note: in expansion of macro ‘BTOBB’ xfsprogs-6.7.0/include/libxfs.h:31: included_from: Included from here. xfsprogs-6.7.0/libxfs/xfs_log_format.h:52:32: note: in definition of macro ‘BLOCK_LSN’ xfsprogs-6.7.0/include/xfs_arch.h:209:34: note: in expansion of macro ‘__swab64’ xfsprogs-6.7.0/logprint/log_misc.c:872:19: note: in expansion of macro ‘be64_to_cpu’ xfsprogs-6.7.0/include/libxfs.h:27: included_from: Included from here. xfsprogs-6.7.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.7.0/logprint/log_misc.c:970:13: note: in expansion of macro ‘be32_to_cpu’ xfsprogs-6.7.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.7.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.7.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.7.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.7.0/logprint/log_misc.c: scope_hint: In function ‘xfs_log_print’ xfsprogs-6.7.0/logprint/log_misc.c:1409:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len’ xfsprogs-6.7.0/logprint/log_misc.c:804:39: note: in definition of macro ‘BBTOOFF64’ xfsprogs-6.7.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.7.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.7.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.7.0/logprint/log_misc.c:1413:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len’ xfsprogs-6.7.0/logprint/log_misc.c:804:39: note: in definition of macro ‘BBTOOFF64’ xfsprogs-6.7.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.7.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.7.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.7.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.7.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.7.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘fatal’ xfsprogs-6.7.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.7.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.7.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘open_device’ xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c:125:13: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected xfsprogs-6.7.0/include/libxfs.h:27: included_from: Included from here. xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c:7: included_from: Included from here. xfsprogs-6.7.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.7.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.7.0/include/platform_defs.h:9: included_from: Included from here. xfsprogs-6.7.0/include/libxfs.h:11: 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.7.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.7.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘restore_v2’ xfsprogs-6.7.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.7.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.7.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.7.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.7.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.7.0/mkfs/proto.c: scope_hint: In function ‘getnum.part.0’ xfsprogs-6.7.0/mkfs/proto.c:49:13: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected xfsprogs-6.7.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.7.0/include/platform_defs.h:9: included_from: Included from here. xfsprogs-6.7.0/include/libxfs.h:11: included_from: Included from here. xfsprogs-6.7.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 # 47| return cvtnum(blksize, sectsize, str); # 48| # 49|-> i = strtoll(str, &sp, 0); # 50| if (i == 0 && sp == str) # 51| return -1LL; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/mkfs/proto.c: scope_hint: In function ‘parseproto’ xfsprogs-6.7.0/mkfs/proto.c:418:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘name’ # 416| memset(&creds, 0, sizeof(creds)); # 417| mstr = getstr(pp); # 418|-> switch (mstr[0]) { # 419| case '-': # 420| fmt = IF_REGULAR; Error: CLANG_WARNING: xfsprogs-6.7.0/mkfs/xfs_mkfs.c:2710:29: warning[core.BitwiseShift]: Right operand is negative in left shift # 2708| ft->dsunit = 0; # 2709| ft->dswidth = 0; # 2710|-> } else if (cfg->dblocks < GIGABYTES(1, cfg->blocklog)) { # 2711| /* # 2712| * Don't use automatic stripe detection if the device Error: CLANG_WARNING: xfsprogs-6.7.0/mkfs/xfs_mkfs.c:3050:31: warning[core.DivideZero]: Division by zero # 3048| } # 3049| cfg->agsize /= cfg->blocksize; # 3050|-> cfg->agcount = cfg->dblocks / cfg->agsize + # 3051| (cfg->dblocks % cfg->agsize != 0); # 3052| Error: CLANG_WARNING: xfsprogs-6.7.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.7.0/quota/edit.c: scope_hint: In function ‘restore_file’ xfsprogs-6.7.0/quota/edit.c:342:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.7.0/quota/edit.c:342:25: note: read of 4 bytes from after the end of ‘buffer’ xfsprogs-6.7.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.7.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.7.0/repair/agbtree.c: scope_hint: In function ‘get_inobt_record’ xfsprogs-6.7.0/repair/agbtree.c:388:36: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.7.0/repair/agbtree.c:11: included_from: Included from here. # 386| # 387| /* Transform the incore record into an on-disk record. */ # 388|-> irec->ir_startino = ino_rec->ino_startnum; # 389| irec->ir_free = ino_rec->ir_free; # 390| Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/repair/attr_repair.c: scope_hint: In function ‘set_da_freemap’ xfsprogs-6.7.0/repair/attr_repair.c:70:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘map’ xfsprogs-6.7.0/include/libxfs.h:30: included_from: Included from here. xfsprogs-6.7.0/repair/attr_repair.c:7: included_from: Included from here. xfsprogs-6.7.0/repair/attr_repair.c:1122:25: note: in expansion of macro ‘XFS_FSB_TO_BB’ xfsprogs-6.7.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.7.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.7.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.7.0/repair/dinode.c:1157:2: warning[deadcode.DeadStores]: Value stored to 'dqid' is never read # 1155| dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); # 1156| dqperchunk = libxfs_calc_dquots_per_chunk(dqchunklen); # 1157|-> dqid = 0; # 1158| qbno = NULLFILEOFF; # 1159| Error: CLANG_WARNING: xfsprogs-6.7.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.7.0/repair/incore.h:308:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.7.0/repair/rmap.c: scope_hint: In function ‘record_inode_reflink_flag’ xfsprogs-6.7.0/include/linux.h:39: included_from: Included from here. xfsprogs-6.7.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.7.0/include/libxfs.h:12: included_from: Included from here. xfsprogs-6.7.0/repair/rmap.c:6: included_from: Included from here. xfsprogs-6.7.0/repair/rmap.c:1174:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/include/libxfs.h:27: included_from: Included from here. xfsprogs-6.7.0/include/xfs_arch.h:138:31: note: in definition of macro ‘__swab64’ xfsprogs-6.7.0/repair/rmap.c:1175:15: note: in expansion of macro ‘be64_to_cpu’ xfsprogs-6.7.0/repair/incore.h:10: included_from: Included from here. # 306| get_inode_offset(struct xfs_mount *mp, xfs_ino_t ino, ino_tree_node_t *irec) # 307| { # 308|-> return XFS_INO_TO_AGINO(mp, ino) - irec->ino_startnum; # 309| } # 310| static inline ino_tree_node_t * Error: GCC_ANALYZER_WARNING (CWE-401): xfsprogs-6.7.0/include/linux.h:39: included_from: Included from here. xfsprogs-6.7.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.7.0/include/libxfs.h:12: included_from: Included from here. xfsprogs-6.7.0/repair/incore_ext.c:7: included_from: Included from here. xfsprogs-6.7.0/repair/incore_ext.c: scope_hint: In function ‘add_bcnt_extent’ xfsprogs-6.7.0/repair/incore_ext.c:276:19: warning[-Wanalyzer-malloc-leak]: leak of ‘mk_extent_tree_nodes(startblock, blockcount, 2)’ xfsprogs-6.7.0/repair/incore_ext.c:276:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/repair/incore_ext.c:271:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/repair/incore_ext.c:272:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/repair/incore_ext.c:272:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/repair/incore_ext.c:276:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/repair/incore_ext.c:295:17: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.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.7.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.7.0/repair/phase6.c: scope_hint: In function ‘process_dir_inode’ xfsprogs-6.7.0/repair/phase6.c:321:22: warning[-Wanalyzer-malloc-leak]: leak of ‘dir_hash_init(*ip.i_disk_size)’ xfsprogs-6.7.0/include/libxfs.h:14: included_from: Included from here. xfsprogs-6.7.0/repair/phase6.c:7: included_from: Included from here. xfsprogs-6.7.0/repair/phase6.c:3188:23: note: in expansion of macro ‘list_entry’ xfsprogs-6.7.0/repair/phase6.c:331:34: note: in expansion of macro ‘DIR_HASH_TAB_SIZE’ # 319| int hsize; # 320| # 321|-> hsize = size / 64; # 322| if (hsize < 16) # 323| hsize = 16; Error: CLANG_WARNING: xfsprogs-6.7.0/repair/phase6.c:2357:12: warning[core.NullDereference]: Access to field 'b_addr' results in a dereference of a null pointer (loaded from variable 'bp') # 2355| xfs_dir2_leaf_entry_t *blp; # 2356| # 2357|-> block = bp->b_addr; # 2358| btp = xfs_dir2_block_tail_p(mp->m_dir_geo, block); # 2359| blp = xfs_dir2_block_leaf_p(btp); Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/repair/phase6.c: scope_hint: In function ‘longform_dir2_entry_check’ xfsprogs-6.7.0/repair/phase6.c:2357:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘bp’ xfsprogs-6.7.0/repair/phase6.c:3188:23: note: in expansion of macro ‘list_entry’ xfsprogs-6.7.0/repair/phase6.c:331:34: note: in expansion of macro ‘DIR_HASH_TAB_SIZE’ # 2355| xfs_dir2_leaf_entry_t *blp; # 2356| # 2357|-> block = bp->b_addr; # 2358| btp = xfs_dir2_block_tail_p(mp->m_dir_geo, block); # 2359| blp = xfs_dir2_block_leaf_p(btp); Error: CLANG_WARNING: xfsprogs-6.7.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.7.0/repair/progress.c:434:35: warning[deadcode.DeadStores]: Although the value stored to 'seconds' is used in the enclosing expression, the value is never actually read from 'seconds' # 432| # 433| *buf = '\0'; # 434|-> weeks = days = hours = minutes = seconds = sum = 0; # 435| if (length >= ONEWEEK) { # 436| weeks = length / ONEWEEK; Error: CLANG_WARNING: xfsprogs-6.7.0/repair/rmap.c:854:12: warning[core.NullDereference]: Access to field 'rm_startblock' results in a dereference of a null pointer (loaded from variable 'array_cur') # 852| /* Set nbno to the bno of the next refcount change */ # 853| if (n < slab_count(rmaps)) # 854|-> nbno = array_cur->rm_startblock; # 855| else # 856| nbno = NULLAGBLOCK; Error: GCC_ANALYZER_WARNING (CWE-476): xfsprogs-6.7.0/repair/rmap.c: scope_hint: In function ‘compute_refcounts’ xfsprogs-6.7.0/repair/rmap.c:854:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘array_cur’ xfsprogs-6.7.0/repair/rmap.c:808:17: note: in expansion of macro ‘ASSERT’ xfsprogs-6.7.0/repair/rmap.c:836:25: note: in expansion of macro ‘ASSERT’ # 852| /* Set nbno to the bno of the next refcount change */ # 853| if (n < slab_count(rmaps)) # 854|-> nbno = array_cur->rm_startblock; # 855| else # 856| nbno = NULLAGBLOCK; Error: GCC_ANALYZER_WARNING (CWE-131): xfsprogs-6.7.0/repair/rt.c: scope_hint: In function ‘rtinit’ xfsprogs-6.7.0/repair/rt.c:33:25: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size # 31| sumfile = calloc(mp->m_rsumsize, 1); # 32| */ # 33|-> if ((btmcompute = calloc(mp->m_sb.sb_rbmblocks * # 34| mp->m_sb.sb_blocksize, 1)) == NULL) # 35| do_error( Error: CLANG_WARNING: xfsprogs-6.7.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.7.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.7.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.7.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.7.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.7.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.7.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.7.0/repair/slab.c: scope_hint: In function ‘qsort_slab’ xfsprogs-6.7.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.7.0/repair/xfs_repair.c:552:13: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 550| do_warn(_("AG %u superblock contains plausible sb_unit value\n"), # 551| agno); # 552|-> new_sunit = sb.sb_unit; # 553| goto fix; # 554| } Error: CLANG_WARNING: xfsprogs-6.7.0/repair/xfs_repair.c:1224:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'msgbuf' # 1222| # 1223| if (parse_sb_version(mp)) { # 1224|-> do_warn( # 1225| _("Found unsupported filesystem features. Exiting now.\n")); # 1226| return(1); Error: GCC_ANALYZER_WARNING (CWE-688): xfsprogs-6.7.0/rtcp/xfs_rtcp.c: scope_hint: In function ‘rtcp’ xfsprogs-6.7.0/rtcp/xfs_rtcp.c:320:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fbuf’ where non-null expected xfsprogs-6.7.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.7.0/scrub/inodes.c: scope_hint: In function ‘scan_ag_bulkstat’ xfsprogs-6.7.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.7.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.7.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.7.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.7.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.7.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.7.0/spaceman/freesp.c: scope_hint: In function ‘histinit’ xfsprogs-6.7.0/spaceman/freesp.c:105:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected xfsprogs-6.7.0/include/platform_defs.h:15: included_from: Included from here. xfsprogs-6.7.0/include/libxfs.h:11: included_from: Included from here. xfsprogs-6.7.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.7.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.7.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.7.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");