Error: SHELLCHECK_WARNING: [#def1] /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): [#def2] /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): [#def3] /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-156): [#def4] /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): [#def5] /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): [#def6] /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): [#def7] /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): [#def8] /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): [#def9] /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): [#def10] /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): [#def11] /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): [#def12] /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: [#def13] /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): [#def14] /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): [#def15] /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): [#def16] /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): [#def17] /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): [#def18] /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): [#def19] /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): [#def20] /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: [#def21] /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): [#def22] /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): [#def23] /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): [#def24] /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: SHELLCHECK_WARNING (CWE-563): [#def25] /usr/sbin/xfs_property:8:1: warning[SC2034]: OPTS appears unused. Verify use (or export if used externally). # 6| # # 7| # 8|-> OPTS="" # 9| USAGE="Usage: xfs_property [-V] [mountpoint|device|file] [list [-v]|get name...|set name=value...|remove name...]" # 10| Error: SHELLCHECK_WARNING (CWE-571): [#def26] /usr/sbin/xfs_property:15:8: warning[SC2155]: Declare and assign separately to avoid masking return values. # 13| # the last line and return it if it's actually a block device. # 14| try_find_loop_dev_for_file() { # 15|-> local x="$(losetup -O NAME -j "$1" 2> /dev/null | tail -n 1)" # 16| test -b "${x}" && echo "${x}" # 17| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def27] xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:168:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/linux.h:39: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:17: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:7: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c: scope_hint: In function ‘btblock_ptr_offset’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:244:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:245:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.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): [#def28] xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c: scope_hint: In function ‘btblock_key_offset’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:226:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:223:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:224:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.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): [#def29] xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c: scope_hint: In function ‘btblock_rec_offset’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:271:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:268:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/btblock.c:269:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-401): [#def30] xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/namei.c: scope_hint: In function ‘path_parse’ xfsprogs-6.11.0-build/xfsprogs-6.11.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): [#def31] xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/namei.c: scope_hint: In function ‘path_navigate’ xfsprogs-6.11.0-build/xfsprogs-6.11.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-476): [#def32] xfsprogs-6.11.0-build/xfsprogs-6.11.0/db/write.c: scope_hint: In function ‘write_string’ xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-457): [#def33] xfsprogs-6.11.0-build/xfsprogs-6.11.0/fsr/xfs_fsr.c: scope_hint: In function ‘packfile’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/fsr/xfs_fsr.c:1216:26: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cur_nextents’ # 1214| nextents = read_fd_bmap(file_fd->fd, statp, &cur_nextents); # 1215| # 1216|-> if (cur_nextents == 1 || cur_nextents <= nextents) { # 1217| if (vflag) # 1218| fsrprintf(_("%s already fully defragmented.\n"), fname); Error: GCC_ANALYZER_WARNING (CWE-476): [#def34] xfsprogs-6.11.0-build/xfsprogs-6.11.0/io/mmap.c: scope_hint: In function ‘print_mapping’ xfsprogs-6.11.0-build/xfsprogs-6.11.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): [#def35] xfsprogs-6.11.0-build/xfsprogs-6.11.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): [#def36] xfsprogs-6.11.0-build/xfsprogs-6.11.0/io/scrub.c: scope_hint: In function ‘scrubv_fill_group’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/io/scrub.c:382:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/io/scrub.c: scope_hint: In function ‘scrubv_fill_group’ # 380| # 381| v = xfrog_scrubv_next_vector(scrubv); # 382|-> v->sv_type = i; # 383| # 384| if (barrier_interval && Error: GCC_ANALYZER_WARNING (CWE-476): [#def37] xfsprogs-6.11.0-build/xfsprogs-6.11.0/io/scrub.c:387:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/io/scrub.c: scope_hint: In function ‘scrubv_fill_group’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/io/scrub.c: scope_hint: In function ‘scrubv_fill_group’ # 385| scrubv->head.svh_nr % (barrier_interval + 1) == 0) { # 386| v = xfrog_scrubv_next_vector(scrubv); # 387|-> v->sv_flags = barrier_mask; # 388| v->sv_type = XFS_SCRUB_TYPE_BARRIER; # 389| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def38] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c: scope_hint: In function '__bitmap_set' xfsprogs-6.11.0-build/xfsprogs-6.11.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.11.0-build/xfsprogs-6.11.0/include/platform_defs.h:26: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c:11: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c:191:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-476): [#def39] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c: scope_hint: In function 'bitmap_iterate_range' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c:370:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'pos' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/bitmap.c:368:9: note: in expansion of macro 'avl_for_each_range_safe' xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-122): [#def40] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c: scope_hint: In function 'hist_cdf' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:137:32: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow /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.11.0-build/xfsprogs-6.11.0/include/platform_defs.h:26: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:11: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:119:9: note: in expansion of macro 'ASSERT' # 135| } # 136| # 137|-> cdf->buckets[i].nr_obs = hs->buckets[i].nr_obs; # 138| cdf->buckets[i].sum = hs->buckets[i].sum; # 139| i--; Error: GCC_ANALYZER_WARNING (CWE-122): [#def41] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:138:29: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:119:9: note: in expansion of macro 'ASSERT' # 136| # 137| cdf->buckets[i].nr_obs = hs->buckets[i].nr_obs; # 138|-> cdf->buckets[i].sum = hs->buckets[i].sum; # 139| i--; # 140| Error: GCC_ANALYZER_WARNING (CWE-122): [#def42] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:142:40: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:119:9: note: in expansion of macro 'ASSERT' # 140| # 141| while (i >= 0) { # 142|-> cdf->buckets[i].nr_obs = hs->buckets[i].nr_obs + # 143| cdf->buckets[i + 1].nr_obs; # 144| Error: GCC_ANALYZER_WARNING (CWE-122): [#def43] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:143:60: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:119:9: note: in expansion of macro 'ASSERT' # 141| while (i >= 0) { # 142| cdf->buckets[i].nr_obs = hs->buckets[i].nr_obs + # 143|-> cdf->buckets[i + 1].nr_obs; # 144| # 145| cdf->buckets[i].sum = hs->buckets[i].sum + Error: GCC_ANALYZER_WARNING (CWE-122): [#def44] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:145:37: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:119:9: note: in expansion of macro 'ASSERT' # 143| cdf->buckets[i + 1].nr_obs; # 144| # 145|-> cdf->buckets[i].sum = hs->buckets[i].sum + # 146| cdf->buckets[i + 1].sum; # 147| i--; Error: GCC_ANALYZER_WARNING (CWE-122): [#def45] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:146:60: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:119:9: note: in expansion of macro 'ASSERT' # 144| # 145| cdf->buckets[i].sum = hs->buckets[i].sum + # 146|-> cdf->buckets[i + 1].sum; # 147| i--; # 148| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def46] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c: scope_hint: In function 'hist_print' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:216:48: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/histogram.c:119:9: note: in expansion of macro 'ASSERT' # 214| hs->buckets[i].sum * 100.0 / hs->tot_sum, # 215| cdf->buckets[i].sum * 100.0 / hs->tot_sum, # 216|-> cdf->buckets[i].nr_obs * 100.0 / hs->tot_obs); # 217| } # 218| Error: GCC_ANALYZER_WARNING (CWE-476): [#def47] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/list_sort.c: scope_hint: In function 'merge_and_restore_back_links' xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-835): [#def48] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/radix-tree.c: scope_hint: In function 'radix_tree_gang_lookup' xfsprogs-6.11.0-build/xfsprogs-6.11.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): [#def49] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/radix-tree.c: scope_hint: In function 'radix_tree_gang_lookup_ex' xfsprogs-6.11.0-build/xfsprogs-6.11.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: CPPCHECK_WARNING (CWE-758): [#def50] xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-401): [#def51] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxcmd/input.c: scope_hint: In function 'breakline' xfsprogs-6.11.0-build/xfsprogs-6.11.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): [#def52] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_ag_resv.c: scope_hint: In function '__xfs_ag_resv_free' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_ag_resv.c:140:56: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_ag_resv.c: scope_hint: In function '__xfs_ag_resv_free' # 138| resv = xfs_perag_resv(pag, type); # 139| if (pag->pag_agno == 0) # 140|-> pag->pag_mount->m_ag_max_usable += resv->ar_asked; # 141| /* # 142| * RMAPBT blocks come from the AGFL and AGFL blocks are always Error: GCC_ANALYZER_WARNING (CWE-476): [#def53] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_ag_resv.c:149:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_ag_resv.c: scope_hint: In function '__xfs_ag_resv_free' # 147| oldresv = resv->ar_orig_reserved; # 148| else # 149|-> oldresv = resv->ar_reserved; # 150| xfs_add_fdblocks(pag->pag_mount, oldresv); # 151| resv->ar_reserved = 0; Error: GCC_ANALYZER_WARNING (CWE-126): [#def54] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:10: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c: scope_hint: In function 'xfs_attr_rmtval_get' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:61: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:61: note: read of 8 bytes from after the end of 'map' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:61: note: valid subscripts for 'map' are '[0]' to '[0]' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' # 429| ASSERT((map[i].br_startblock != DELAYSTARTBLOCK) && # 430| (map[i].br_startblock != HOLESTARTBLOCK)); # 431|-> dblkno = XFS_FSB_TO_DADDR(mp, map[i].br_startblock); # 432| dblkcnt = XFS_FSB_TO_BB(mp, map[i].br_blockcount); # 433| error = xfs_buf_read(mp->m_ddev_targp, dblkno, dblkcnt, Error: GCC_ANALYZER_WARNING (CWE-126): [#def55] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:432:59: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:432:59: note: read of 8 bytes from after the end of 'map' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:432:59: note: valid subscripts for 'map' are '[0]' to '[0]' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' # 430| (map[i].br_startblock != HOLESTARTBLOCK)); # 431| dblkno = XFS_FSB_TO_DADDR(mp, map[i].br_startblock); # 432|-> dblkcnt = XFS_FSB_TO_BB(mp, map[i].br_blockcount); # 433| error = xfs_buf_read(mp->m_ddev_targp, dblkno, dblkcnt, # 434| 0, &bp, &xfs_attr3_rmt_buf_ops); Error: GCC_ANALYZER_WARNING (CWE-126): [#def56] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:447:41: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:454:35: note: in definition of macro 'XFS_FSB_TO_BB' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:443:41: note: in expansion of macro 'XFS_AGB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_format.h:444:25: note: in expansion of macro 'XFS_FSB_TO_AGNO' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:431:34: note: in expansion of macro 'XFS_FSB_TO_DADDR' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:447:41: note: read of 8 bytes from after the end of 'map' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_attr_remote.c:447:41: note: valid subscripts for 'map' are '[0]' to '[0]' # 445| # 446| /* roll attribute extent map forwards */ # 447|-> lblkno += map[i].br_blockcount; # 448| blkcnt -= map[i].br_blockcount; # 449| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def57] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap.h:152:20: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'irec1.br_startblock' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_exchmaps.c: scope_hint: In function 'xfs_exchmaps_estimate' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_exchmaps.c: scope_hint: In function 'xfs_exchmaps_estimate' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_exchmaps.c: scope_hint: In function 'xfs_exchmaps_estimate' # 150| static inline bool xfs_bmap_is_real_extent(const struct xfs_bmbt_irec *irec) # 151| { # 152|-> return irec->br_startblock != HOLESTARTBLOCK && # 153| irec->br_startblock != DELAYSTARTBLOCK && # 154| !isnullstartblock(irec->br_startblock); Error: GCC_ANALYZER_WARNING (CWE-476): [#def58] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/libxfs_priv.h:60: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap_btree.c:6: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap_btree.c: scope_hint: In function 'libxfs_bmbt_init_cursor' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap_btree.c:584:50: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap_btree.c:584:35: note: in expansion of macro 'be16_to_cpu' xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap_btree.c:584:35: note: in expansion of macro 'be16_to_cpu' # 582| struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); # 583| # 584|-> cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; # 585| cur->bc_ino.forksize = xfs_inode_fork_size(ip, whichfork); # 586| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def59] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap_btree.c: scope_hint: In function 'libxfs_bmbt_commit_staged_btree' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap_btree.c:627:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected <built-in>: note: argument 1 of '__builtin_memcpy' must be non-null # 625| ifp = xfs_ifork_ptr(cur->bc_ino.ip, whichfork); # 626| xfs_idestroy_fork(ifp); # 627|-> memcpy(ifp, ifake->if_fork, sizeof(struct xfs_ifork)); # 628| # 629| switch (ifp->if_format) { Error: GCC_ANALYZER_WARNING (CWE-476): [#def60] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.c:841:16: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.c: scope_hint: In function 'libxfs_btree_get_block.part.0' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.c:849:1: note: in expansion of macro 'xfs_btree_get_block' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.c: scope_hint: In function 'libxfs_btree_get_block.part.0' # 839| struct xfs_ifork *ifp = xfs_btree_ifork_ptr(cur); # 840| # 841|-> return (struct xfs_btree_block *)ifp->if_broot; # 842| } # 843| Error: GCC_ANALYZER_WARNING (CWE-476): [#def61] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.h:415:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'block' xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.h:415:16: note: in expansion of macro 'be16_to_cpu' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/libxfs_priv.h:43: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.c: scope_hint: In function 'libxfs_btree_lookup' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.c:5376:1: note: in expansion of macro 'xfs_btree_goto_left_edge' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.c:5383:17: note: in expansion of macro 'xfs_btree_lookup' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.c:1982:1: note: in expansion of macro 'xfs_btree_lookup' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.c:1998:13: note: in expansion of macro 'XFS_IS_CORRUPT' xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:130:31: note: in definition of macro '__swab16' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_btree.h:415:16: note: in expansion of macro 'be16_to_cpu' # 413| static inline int xfs_btree_get_numrecs(const struct xfs_btree_block *block) # 414| { # 415|-> return be16_to_cpu(block->bb_numrecs); # 416| } # 417| Error: GCC_ANALYZER_WARNING (CWE-476): [#def62] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_dir2_block.c: scope_hint: In function 'xfs_dir2_sf_to_block' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_dir2_block.c:1242:36: warning[-Wanalyzer-null-dereference]: dereference of NULL 'sfep' # 1240| dep = bp->b_addr + newoffset; # 1241| dep->inumber = cpu_to_be64(xfs_dir2_sf_get_ino(mp, sfp, sfep)); # 1242|-> dep->namelen = sfep->namelen; # 1243| xfs_dir2_data_put_ftype(mp, dep, # 1244| xfs_dir2_sf_get_ftype(mp, sfep)); Error: GCC_ANALYZER_WARNING (CWE-476): [#def63] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_dir2_leaf.c: scope_hint: In function 'xfs_dir2_leaf_lookup_int' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_dir2_leaf.c:1341:60: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dbp' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/libxfs_priv.h:60: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_dir2_leaf.c:7: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:134:31: note: in definition of macro '__swab32' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_dir2_leaf.c:1310:25: note: in expansion of macro 'be32_to_cpu' xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:134:31: note: in definition of macro '__swab32' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_dir2_leaf.c:1315:21: note: in expansion of macro 'be32_to_cpu' # 1339| * Point to the data entry. # 1340| */ # 1341|-> dep = (xfs_dir2_data_entry_t *)((char *)dbp->b_addr + # 1342| xfs_dir2_dataptr_to_off(args->geo, # 1343| be32_to_cpu(lep->address))); Error: GCC_ANALYZER_WARNING (CWE-476): [#def64] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_exchmaps.c:6: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_exchmaps.c: scope_hint: In function 'xmi_ensure_delta_nextents' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_exchmaps.c:876:35: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/libxfs_priv.h:259:26: note: in definition of macro 'check_add_overflow' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_exchmaps.c:14: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/libxfs_priv.h:259:26: note: in definition of macro 'check_add_overflow' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/libxfs_priv.h:259:26: note: in definition of macro 'check_add_overflow' # 874| * coded into the overflow check. # 875| */ # 876|-> if (check_add_overflow(ifp->if_nextents, (uint64_t)delta, # 877| &new_nextents)) # 878| return -EFBIG; Error: GCC_ANALYZER_WARNING (CWE-476): [#def65] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'libxfs_init_local_fork' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c:60:30: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 58| new_data[size] = '\0'; # 59| # 60|-> ifp->if_data = new_data; # 61| } else { # 62| ifp->if_data = NULL; Error: GCC_ANALYZER_WARNING (CWE-476): [#def66] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c:62:30: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 60| ifp->if_data = new_data; # 61| } else { # 62|-> ifp->if_data = NULL; # 63| } # 64| Error: GCC_ANALYZER_WARNING (CWE-476): [#def67] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iformat_extents' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c:133:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 131| } # 132| # 133|-> ifp->if_bytes = 0; # 134| ifp->if_data = NULL; # 135| ifp->if_height = 0; Error: GCC_ANALYZER_WARNING (CWE-476): [#def68] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c:7: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iformat_btree' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c:197:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/libxfs_priv.h:207:34: note: in definition of macro 'unlikely' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/libxfs_priv.h:207:34: note: in definition of macro 'unlikely' # 195| * blocks. # 196| */ # 197|-> if (unlikely(ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork) || # 198| nrecs == 0 || # 199| XFS_BMDR_SPACE_CALC(nrecs) > Error: GCC_ANALYZER_WARNING (CWE-476): [#def69] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iroot_realloc' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c:409:24: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 407| * allocate it now and get out. # 408| */ # 409|-> if (ifp->if_broot_bytes == 0) { # 410| new_size = XFS_BMAP_BROOT_SPACE_CALC(mp, rec_diff); # 411| ifp->if_broot = kmalloc(new_size, Error: GCC_ANALYZER_WARNING (CWE-476): [#def70] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c:445:43: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 443| */ # 444| ASSERT((ifp->if_broot != NULL) && (ifp->if_broot_bytes > 0)); # 445|-> cur_max = xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, 0); # 446| new_max = cur_max + rec_diff; # 447| ASSERT(new_max >= 0); Error: GCC_ANALYZER_WARNING (CWE-476): [#def71] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'libxfs_idata_realloc' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c:515:47: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 513| { # 514| struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); # 515|-> int64_t new_size = ifp->if_bytes + byte_diff; # 516| # 517| ASSERT(new_size >= 0); Error: GCC_ANALYZER_WARNING (CWE-476): [#def72] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c: scope_hint: In function 'xfs_iext_count_extend' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.c:792:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 790| # 791| /* no point in upgrading if if_nextents overflows */ # 792|-> nr_exts = ifp->if_nextents + nr_to_add; # 793| if (nr_exts < ifp->if_nextents) # 794| return -EFBIG; Error: GCC_ANALYZER_WARNING (CWE-476): [#def73] xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_inode_fork.h:84:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap.c: scope_hint: In function '__xfs_bunmapi' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap.c:6: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/libxfs_priv.h:207:34: note: in definition of macro 'unlikely' xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_bmap.c:5444: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: GCC_ANALYZER_WARNING (CWE-476): [#def74] xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c: scope_hint: In function ‘xlog_print_add_to_trans’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:144:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘item’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:804:39: note: in definition of macro ‘BBTOOFF64’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs.h:46: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:17: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:6: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_fs.h:1015:27: note: in definition of macro ‘BBTOB’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:853:28: note: in expansion of macro ‘BTOBB’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:36: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libxfs/xfs_log_format.h:52:32: note: in definition of macro ‘BLOCK_LSN’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:209:34: note: in expansion of macro ‘__swab64’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:872:19: note: in expansion of macro ‘be64_to_cpu’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:32: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:898:13: note: in expansion of macro ‘be32_to_cpu’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:908:17: note: in expansion of macro ‘be32_to_cpu’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:970:13: note: in expansion of macro ‘be32_to_cpu’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:1096: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: GCC_ANALYZER_WARNING (CWE-457): [#def75] xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c: scope_hint: In function ‘xfs_log_print’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:1420:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:804:39: note: in definition of macro ‘BBTOOFF64’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:1419:13: note: in expansion of macro ‘be32_to_cpu’ # 1418| # 1419| if (be32_to_cpu(hdr->h_version) == 2) { # 1420|-> if (xlog_print_extended_headers(fd, len, &blkno, hdr, &num_hdrs, &xhdrs) != 0) # 1421| break; # 1422| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def76] xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:1424:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:804:39: note: in definition of macro ‘BBTOOFF64’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/logprint/log_misc.c:1419:13: note: in expansion of macro ‘be32_to_cpu’ # 1422| } # 1423| # 1424|-> error = xlog_print_record(log, fd, num_ops, len, &read_type, &partial_buf, # 1425| hdr, xhdrs, first_hdr_found); # 1426| first_hdr_found++; Error: GCC_ANALYZER_WARNING (CWE-617): [#def77] xfsprogs-6.11.0-build/xfsprogs-6.11.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘fatal’ xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-688): [#def78] xfsprogs-6.11.0-build/xfsprogs-6.11.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘open_device’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/mdrestore/xfs_mdrestore.c:123:13: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:32: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/mdrestore/xfs_mdrestore.c:7: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/mdrestore/xfs_mdrestore.c:553: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.11.0-build/xfsprogs-6.11.0/include/platform_defs.h:9: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:16: included_from: Included from here. /usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null # 121| *is_file = false; # 122| # 123|-> if (stat(path, &statbuf) < 0) { # 124| /* ok, assume it's a file and create it */ # 125| open_flags |= O_CREAT; Error: GCC_ANALYZER_WARNING (CWE-617): [#def79] xfsprogs-6.11.0-build/xfsprogs-6.11.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘restore_v2’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/mdrestore/xfs_mdrestore.c:401:17: warning[-Wanalyzer-tainted-assertion]: use of attacked-controlled value in condition for assertion # 399| (be64_to_cpu(xme.xme_addr) & XME_ADDR_DEVICE_MASK) != # 400| XME_ADDR_DATA_DEVICE) # 401|-> fatal("Invalid superblock disk address/length\n"); # 402| # 403| len = BBTOB(be32_to_cpu(xme.xme_len)); Error: GCC_ANALYZER_WARNING (CWE-688): [#def80] xfsprogs-6.11.0-build/xfsprogs-6.11.0/mkfs/proto.c: scope_hint: In function ‘getnum.part.0’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/mkfs/proto.c:48:13: warning[-Wanalyzer-null-argument]: use of NULL ‘str’ where non-null expected xfsprogs-6.11.0-build/xfsprogs-6.11.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.11.0-build/xfsprogs-6.11.0/include/platform_defs.h:9: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:16: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.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 # 46| return cvtnum(blksize, sectsize, str); # 47| # 48|-> i = strtoll(str, &sp, 0); # 49| if (i == 0 && sp == str) # 50| return -1LL; Error: GCC_ANALYZER_WARNING (CWE-476): [#def81] xfsprogs-6.11.0-build/xfsprogs-6.11.0/mkfs/proto.c: scope_hint: In function ‘parseproto’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/mkfs/proto.c:514:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘name’ # 512| memset(&creds, 0, sizeof(creds)); # 513| mstr = getstr(pp); # 514|-> switch (mstr[0]) { # 515| case '-': # 516| fmt = IF_REGULAR; Error: GCC_ANALYZER_WARNING (CWE-126): [#def82] xfsprogs-6.11.0-build/xfsprogs-6.11.0/quota/edit.c: scope_hint: In function ‘restore_file’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/quota/edit.c:342:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xfsprogs-6.11.0-build/xfsprogs-6.11.0/quota/edit.c:342:25: note: read of 4 bytes from after the end of ‘buffer’ xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-476): [#def83] xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/agbtree.c: scope_hint: In function ‘get_inobt_records’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/agbtree.c:417:44: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/agbtree.c:11: included_from: Included from here. # 415| # 416| /* Transform the incore record into an on-disk record. */ # 417|-> irec->ir_startino = ino_rec->ino_startnum; # 418| irec->ir_free = ino_rec->ir_free; # 419| Error: GCC_ANALYZER_WARNING (CWE-476): [#def84] xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/attr_repair.c: scope_hint: In function ‘set_da_freemap’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/attr_repair.c:70:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘map’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:35: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/attr_repair.c:7: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/attr_repair.c:1209:25: note: in expansion of macro ‘XFS_FSB_TO_BB’ xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-476): [#def85] xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore.h:305:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/rmap.c: scope_hint: In function ‘record_inode_reflink_flag’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/linux.h:39: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:17: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/rmap.c:6: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/rmap.c:1331:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:32: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs_arch.h:138:31: note: in definition of macro ‘__swab64’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/rmap.c:1332:15: note: in expansion of macro ‘be64_to_cpu’ xfsprogs-6.11.0-build/xfsprogs-6.11.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): [#def86] xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/linux.h:39: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/xfs.h:9: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:17: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore_ext.c:7: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore_ext.c: scope_hint: In function ‘add_bcnt_extent’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore_ext.c:276:19: warning[-Wanalyzer-malloc-leak]: leak of ‘mk_extent_tree_nodes(startblock, blockcount, 2)’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore_ext.c:276:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore_ext.c:271:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore_ext.c:272:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore_ext.c:272:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore_ext.c:276:9: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/incore_ext.c:295:17: note: in expansion of macro ‘ASSERT’ xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-401): [#def87] xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/phase6.c: scope_hint: In function ‘process_dir_inode’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/phase6.c:317:22: warning[-Wanalyzer-malloc-leak]: leak of ‘dir_hash_init(*ip.i_disk_size)’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/include/libxfs.h:19: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/phase6.c:7: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/phase6.c:3238:23: note: in expansion of macro ‘list_entry’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/phase6.c:327:34: note: in expansion of macro ‘DIR_HASH_TAB_SIZE’ # 315| int hsize; # 316| # 317|-> hsize = size / 64; # 318| if (hsize < 16) # 319| hsize = 16; Error: GCC_ANALYZER_WARNING (CWE-476): [#def88] xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/slab.c: scope_hint: In function ‘qsort_slab’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/repair/slab.c:229:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘qs’ # 227| while (hdr) { # 228| qs = malloc(sizeof(struct qsort_slab)); # 229|-> qs->slab = slab; # 230| qs->hdr = hdr; # 231| qs->compare_fn = compare_fn; Error: GCC_ANALYZER_WARNING (CWE-688): [#def89] xfsprogs-6.11.0-build/xfsprogs-6.11.0/rtcp/xfs_rtcp.c: scope_hint: In function ‘rtcp’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/rtcp/xfs_rtcp.c:320:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fbuf’ where non-null expected xfsprogs-6.11.0-build/xfsprogs-6.11.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): [#def90] xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/inodes.c: scope_hint: In function ‘scan_ag_bulkstat’ xfsprogs-6.11.0-build/xfsprogs-6.11.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: GCC_ANALYZER_WARNING (CWE-476): [#def91] xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c: scope_hint: In function ‘xfrog_scrubv_add_item’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c:280:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ /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.11.0-build/xfsprogs-6.11.0/include/platform_defs.h:26: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/libfrog/paths.h:9: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c:14: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c:20: included_from: Included from here. xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c:321:9: note: in expansion of macro ‘foreach_scrub_type’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c: scope_hint: In function ‘xfrog_scrubv_add_item’ # 278| # 279| v = xfrog_scrubv_next_vector(scrubv); # 280|-> v->sv_type = scrub_type; # 281| if (want_repair) # 282| v->sv_flags |= XFS_SCRUB_IFLAG_REPAIR; Error: GCC_ANALYZER_WARNING (CWE-476): [#def92] xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c:296:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c: scope_hint: In function ‘scrub_call_kernel’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c:321:9: note: in expansion of macro ‘foreach_scrub_type’ xfsprogs-6.11.0-build/xfsprogs-6.11.0/scrub/scrub.c:321:9: note: in expansion of macro ‘foreach_scrub_type’ # 294| v = xfrog_scrubv_next_vector(scrubv); # 295| # 296|-> v->sv_type = XFS_SCRUB_TYPE_BARRIER; # 297| v->sv_flags = XFS_SCRUB_OFLAG_CORRUPT | XFS_SCRUB_OFLAG_XFAIL | # 298| XFS_SCRUB_OFLAG_XCORRUPT | XFS_SCRUB_OFLAG_INCOMPLETE;
analyzer-version-clippy | 1.82.0 |
analyzer-version-cppcheck | 2.16.0 |
analyzer-version-gcc | 14.2.1 |
analyzer-version-gcc-analyzer | 15.0.0 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-203.us-west-2.compute.internal |
mock-config | fedora-rawhide-gcc-latest-x86_64 |
project-name | xfsprogs-6.11.0-1.fc42 |
store-results-to | /tmp/tmpkp4tav67/xfsprogs-6.11.0-1.fc42.tar.xz |
time-created | 2024-11-13 03:38:30 |
time-finished | 2024-11-13 03:42:09 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpkp4tav67/xfsprogs-6.11.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpkp4tav67/xfsprogs-6.11.0-1.fc42.src.rpm' |
tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |