e2fsprogs-1.47.1-6.fc42

List of Findings

Error: SHELLCHECK_WARNING (CWE-398): [#def1]
/usr/bin/compile_et:23:49: warning[SC2163]: This does not export 'as_var'. Remove $/${} for that, or use ${var?} to quiet.
#   21|     LC_TELEPHONE LC_TIME
#   22|   do
#   23|->   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
#   24|       eval $as_var=C; export $as_var
#   25|     else

Error: SHELLCHECK_WARNING (CWE-398): [#def2]
/usr/bin/compile_et:24:28: warning[SC2163]: This does not export 'as_var'. Remove $/${} for that, or use ${var?} to quiet.
#   22|   do
#   23|     if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
#   24|->     eval $as_var=C; export $as_var
#   25|     else
#   26|       $as_unset $as_var

Error: SHELLCHECK_WARNING (CWE-457): [#def3]
/usr/bin/compile_et:26:5: warning[SC2154]: as_unset is referenced but not assigned.
#   24|       eval $as_var=C; export $as_var
#   25|     else
#   26|->     $as_unset $as_var
#   27|     fi
#   28|   done

Error: SHELLCHECK_WARNING (CWE-456): [#def4]
/usr/bin/mk_cmds:7:1: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#    5|   DIR=/usr/share/ss
#    6|   AWK=gawk
#    7|-> SED=sed
#    8|   
#    9|   for as_var in \

Error: SHELLCHECK_WARNING (CWE-398): [#def5]
/usr/bin/mk_cmds:14:49: warning[SC2163]: This does not export 'as_var'. Remove $/${} for that, or use ${var?} to quiet.
#   12|     LC_TELEPHONE LC_TIME
#   13|   do
#   14|->   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
#   15|       eval $as_var=C; export $as_var
#   16|     else

Error: SHELLCHECK_WARNING (CWE-398): [#def6]
/usr/bin/mk_cmds:15:28: warning[SC2163]: This does not export 'as_var'. Remove $/${} for that, or use ${var?} to quiet.
#   13|   do
#   14|     if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
#   15|->     eval $as_var=C; export $as_var
#   16|     else
#   17|       $as_unset $as_var

Error: SHELLCHECK_WARNING (CWE-457): [#def7]
/usr/bin/mk_cmds:17:5: warning[SC2154]: as_unset is referenced but not assigned.
#   15|       eval $as_var=C; export $as_var
#   16|     else
#   17|->     $as_unset $as_var
#   18|     fi
#   19|   done

Error: SHELLCHECK_WARNING (CWE-477): [#def8]
/usr/sbin/e2scrub:69:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   67|   	# fail service uses the service name to gather log messages for the
#   68|   	# error report.
#   69|-> 	if [ -n "${SERVICE_MODE}" -a "${ret}" -ne 0 ]; then
#   70|   		test "${ret}" -ne 0 && ret=1
#   71|   		sleep 2

Error: SHELLCHECK_WARNING (CWE-571): [#def9]
/usr/sbin/e2scrub:109:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  107|   # Find the device for a given mountpoint
#  108|   dev_from_mount() {
#  109|-> 	local mountpt="$(realpath "$1")"
#  110|   
#  111|   	lsblk -o NAME,FSTYPE,MOUNTPOINT -p -P -n 2> /dev/null | while read vars; do

Error: SHELLCHECK_WARNING (CWE-571): [#def10]
/usr/sbin/e2scrub:129:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  127|   dev_from_arg() {
#  128|   	local dev="$1"
#  129|-> 	local fstype="$(lsblk -o FSTYPE -n "${dev}" 2> /dev/null)"
#  130|   
#  131|   	case "${fstype}" in

Error: SHELLCHECK_WARNING: [#def11]
/usr/sbin/e2scrub:185:35: warning[SC2319]: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.
#  183|   	# Remove and wait for removal to succeed.
#  184|   	${DBG} lvremove -f "${LVM2_VG_NAME}/${snap}"
#  185|-> 	while [ -e "${snap_dev}" ] && [ "$?" -eq "5" ]; do
#  186|   		sleep 0.5
#  187|   		${DBG} lvremove -f "${LVM2_VG_NAME}/${snap}"

Error: SHELLCHECK_WARNING: [#def12]
/usr/sbin/e2scrub:213:35: warning[SC2319]: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.
#  211|   	lvremove_deadline="$(( $(date "+%s") + 30))"
#  212|   	${DBG} lvremove -f "${LVM2_VG_NAME}/${snap}" 2>/dev/null
#  213|-> 	while [ -e "${snap_dev}" ] && [ "$?" -eq "5" ] &&
#  214|   	      [ "$(date "+%s")" -lt "${lvremove_deadline}" ]; do
#  215|   		sleep 0.5

Error: SHELLCHECK_WARNING (CWE-477): [#def13]
/usr/sbin/e2scrub_all:59:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   57|   	# actually happened.
#   58|   
#   59|-> 	if [ -n "${SERVICE_MODE}" -a "${ret}" -ne 0 ]; then
#   60|   		test "${ret}" -ne 0 && ret=1
#   61|   	fi

Error: SHELLCHECK_WARNING (CWE-477): [#def14]
/usr/sbin/e2scrub_all:78:27: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   76|   
#   77|   # If we're in service mode and the service is not enabled via config file...
#   78|-> if [ -n "${SERVICE_MODE}" -a "${periodic_e2scrub}" -ne 1 ]; then
#   79|   	# ...don't start e2scrub processes.
#   80|   	if [ "${reap}" -eq 0 ]; then

Error: SHELLCHECK_WARNING (CWE-571): [#def15]
/usr/sbin/e2scrub_all:118:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  116|   # Find scrub targets, make sure we only do this once.
#  117|   ls_scan_targets() {
#  118|->     local devices=$(lvs -o lv_path --noheadings -S "lv_active=active,lv_role=public,lv_role!=snapshot,vg_free>=${snap_size_mb}")
#  119|   
#  120|       if [ -z "$devices" ]; then

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/debugfs/debugfs.c: scope_hint: In function ‘source_file’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/debugfs/debugfs.c:2541:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
# 2539|   	if (f != stdin)
# 2540|   		fclose(f);
# 2541|-> 	return exit_status;
# 2542|   }
# 2543|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/debugfs/debugfs.c:2541:16: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
# 2539|   	if (f != stdin)
# 2540|   		fclose(f);
# 2541|-> 	return exit_status;
# 2542|   }
# 2543|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/dirinfo.c: scope_hint: In function ‘setup_tdb’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/dirinfo.c:70:25: warning[-Wanalyzer-malloc-leak]: leak of ‘*db.tdb_fn’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/dirinfo.c: scope_hint: In function ‘setup_tdb’
#   68|   		return;
#   69|   
#   70|-> 	uuid_unparse(ctx->fs->super->s_uuid, uuid);
#   71|   	sprintf(db->tdb_fn, "%s/%s-dirinfo-XXXXXX", tdb_dir, uuid);
#   72|   	save_umask = umask(077);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/encrypted_files.c: scope_hint: In function ‘append_ino_and_policy_id’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/encrypted_files.c:337:44: warning[-Wanalyzer-malloc-leak]: leak of ‘*info.file_ranges’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/encrypted_files.c: scope_hint: In function ‘append_ino_and_policy_id’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/encrypted_files.c: scope_hint: In function ‘append_ino_and_policy_id’
#  335|   					    new_capacity * sizeof(*range));
#  336|   
#  337|-> 		info->file_ranges_capacity = new_capacity;
#  338|   	}
#  339|   	range = &info->file_ranges[info->file_ranges_count++];

Error: GCC_ANALYZER_WARNING (CWE-688): [#def20]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/logfile.c: scope_hint: In function ‘append_string’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/logfile.c:62:9: warning[-Wanalyzer-null-argument]: use of NULL ‘s.s’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#   60|   		}
#   61|   	}
#   62|-> 	memcpy(s->s + s->end, a, len);
#   63|   	s->end += len;
#   64|   	s->s[s->end] = 0;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def21]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/logfile.c:62:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘a’
#   60|   		}
#   61|   	}
#   62|-> 	memcpy(s->s + s->end, a, len);
#   63|   	s->end += len;
#   64|   	s->s[s->end] = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def22]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/logfile.c: scope_hint: In function ‘set_up_log_file’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/logfile.c:317:53: warning[-Wanalyzer-null-argument]: use of NULL ‘s.s’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
#  315|   
#  316|   	if (log_dir && log_dir[0]) {
#  317|-> 		alloc_string(&s1, strlen(log_dir) + strlen(s.s) + 2);
#  318|   		append_string(&s1, log_dir, 0);
#  319|   		append_string(&s1, "/", 1);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def23]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/logfile.c:317:53: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*s.s’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/e2fsck.h:13: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/logfile.c:20: included_from: Included from here.
/usr/include/string.h:407:15: note: argument 1 of ‘strlen’ must be a pointer to a null-terminated string
#  315|   
#  316|   	if (log_dir && log_dir[0]) {
#  317|-> 		alloc_string(&s1, strlen(log_dir) + strlen(s.s) + 2);
#  318|   		append_string(&s1, log_dir, 0);
#  319|   		append_string(&s1, "/", 1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def24]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/message.c: scope_hint: In function ‘expand_inode_expression’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/message.c:290:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘fs’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/e2fsck.h:43: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/message.c:100: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/message.c:257:23: note: in expansion of macro ‘_’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/message.c:257:23: note: in expansion of macro ‘_’
#  288|   		break;
#  289|   	case 'b':
#  290|-> 		if (ext2fs_has_feature_huge_file(fs->super))
#  291|   			fprintf(f, "%llu", inode->i_blocks +
#  292|   				(((long long) inode->osd2.linux2.l_i_blocks_hi)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def25]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/pass1.c: scope_hint: In function ‘check_ext_attr’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/pass1.c:2690:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘entry_quota_blocks’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/e2fsck.h:35: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/pass1.c:51: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:760:43: note: in definition of macro ‘EXT2FS_B2C’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:760:43: note: in definition of macro ‘EXT2FS_B2C’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:106: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2_ext_attr.h:44:12: note: in definition of macro ‘EXT2_EXT_ATTR_LEN’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2_ext_attr.h:44:12: note: in definition of macro ‘EXT2_EXT_ATTR_LEN’
# 2688|   				goto clear_extattr;
# 2689|   
# 2690|-> 			quota_blocks += entry_quota_blocks;
# 2691|   			quota_inodes++;
# 2692|   		}

Error: GCC_ANALYZER_WARNING (CWE-465): [#def26]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/pass2.c: scope_hint: In function ‘check_dir_block’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/pass2.c:1268:69: warning[-Wanalyzer-deref-before-check]: check of ‘dx_db’ for NULL after already dereferencing it
# 1266|   			dx_db->type = DX_DIRBLOCK_NODE;
# 1267|   		}
# 1268|-> 		is_leaf = dx_db ? (dx_db->type == DX_DIRBLOCK_LEAF) : 0;
# 1269|   	}
# 1270|   out_htree:

Error: CPPCHECK_WARNING (CWE-476): [#def27]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:826: warning[nullPointer]: Possible null pointer dereference: limit
#  824|   			c2--;
#  825|   		}
#  826|-> 		limit->count = ext2fs_cpu_to_le16(limit->limit - c2);
#  827|   		limit->limit = ext2fs_cpu_to_le16(limit->limit);
#  828|   	} else {

Error: CPPCHECK_WARNING (CWE-476): [#def28]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:827: warning[nullPointer]: Possible null pointer dereference: limit
#  825|   		}
#  826|   		limit->count = ext2fs_cpu_to_le16(limit->limit - c2);
#  827|-> 		limit->limit = ext2fs_cpu_to_le16(limit->limit);
#  828|   	} else {
#  829|   		c2 = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def29]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:869: warning[nullPointer]: Possible null pointer dereference: int_limit
#  867|   			c3--;
#  868|   		}
#  869|-> 		int_limit->count = ext2fs_cpu_to_le16(limit->limit - c2);
#  870|   		int_limit->limit = ext2fs_cpu_to_le16(limit->limit);
#  871|   

Error: CPPCHECK_WARNING (CWE-476): [#def30]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:869: warning[nullPointer]: Possible null pointer dereference: limit
#  867|   			c3--;
#  868|   		}
#  869|-> 		int_limit->count = ext2fs_cpu_to_le16(limit->limit - c2);
#  870|   		int_limit->limit = ext2fs_cpu_to_le16(limit->limit);
#  871|   

Error: CPPCHECK_WARNING (CWE-476): [#def31]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:870: warning[nullPointer]: Possible null pointer dereference: int_limit
#  868|   		}
#  869|   		int_limit->count = ext2fs_cpu_to_le16(limit->limit - c2);
#  870|-> 		int_limit->limit = ext2fs_cpu_to_le16(limit->limit);
#  871|   
#  872|   		limit->count = ext2fs_cpu_to_le16(limit->limit - c3);

Error: CPPCHECK_WARNING (CWE-476): [#def32]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:870: warning[nullPointer]: Possible null pointer dereference: limit
#  868|   		}
#  869|   		int_limit->count = ext2fs_cpu_to_le16(limit->limit - c2);
#  870|-> 		int_limit->limit = ext2fs_cpu_to_le16(limit->limit);
#  871|   
#  872|   		limit->count = ext2fs_cpu_to_le16(limit->limit - c3);

Error: CPPCHECK_WARNING (CWE-476): [#def33]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:872: warning[nullPointer]: Possible null pointer dereference: limit
#  870|   		int_limit->limit = ext2fs_cpu_to_le16(limit->limit);
#  871|   
#  872|-> 		limit->count = ext2fs_cpu_to_le16(limit->limit - c3);
#  873|   		limit->limit = ext2fs_cpu_to_le16(limit->limit);
#  874|   

Error: CPPCHECK_WARNING (CWE-476): [#def34]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:873: warning[nullPointer]: Possible null pointer dereference: limit
#  871|   
#  872|   		limit->count = ext2fs_cpu_to_le16(limit->limit - c3);
#  873|-> 		limit->limit = ext2fs_cpu_to_le16(limit->limit);
#  874|   
#  875|   	}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def35]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘e2fsck_rehash_directories’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:1170:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘iter’
# 1168|   			ino = dir->ino;
# 1169|   		} else {
# 1170|-> 			if (!ext2fs_u32_list_iterate(iter, &ino))
# 1171|   				break;
# 1172|   		}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def36]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c:1197:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘iter’
# 1195|   		e2fsck_dir_info_iter_end(ctx, dirinfo_iter);
# 1196|   	else
# 1197|-> 		ext2fs_u32_list_iterate_end(iter);
# 1198|   
# 1199|   	if (ctx->dirs_to_hash)

Error: CPPCHECK_WARNING (CWE-476): [#def37]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/unix.c:82: error[ctunullpointer]: Null pointer dereference: ctx
#   80|   		"\t\t[-l|-L bad_blocks_file] [-C fd] [-j external_journal]\n"
#   81|   		"\t\t[-E extended-options] [-z undo_file] device\n"),
#   82|-> 		ctx->program_name ? ctx->program_name : "e2fsck");
#   83|   
#   84|   	fprintf(stderr, "%s", _("\nEmergency help:\n"

Error: CPPCHECK_WARNING (CWE-476): [#def38]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/unix.c:82: warning[nullPointer]: Possible null pointer dereference: ctx
#   80|   		"\t\t[-l|-L bad_blocks_file] [-C fd] [-j external_journal]\n"
#   81|   		"\t\t[-E extended-options] [-z undo_file] device\n"),
#   82|-> 		ctx->program_name ? ctx->program_name : "e2fsck");
#   83|   
#   84|   	fprintf(stderr, "%s", _("\nEmergency help:\n"

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/unix.c: scope_hint: In function ‘usage’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/unix.c:82:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ctx’
#   80|   		"\t\t[-l|-L bad_blocks_file] [-C fd] [-j external_journal]\n"
#   81|   		"\t\t[-E extended-options] [-z undo_file] device\n"),
#   82|-> 		ctx->program_name ? ctx->program_name : "e2fsck");
#   83|   
#   84|   	fprintf(stderr, "%s", _("\nEmergency help:\n"

Error: GCC_ANALYZER_WARNING (CWE-465): [#def40]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/unix.c: scope_hint: In function ‘main’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/unix.c:1556:20: warning[-Wanalyzer-deref-before-check]: check of ‘fs’ for NULL after already dereferencing it
# 1554|   			fs = NULL;
# 1555|   		}
# 1556|-> 		if (!fs || (fs->group_desc_count > 1)) {
# 1557|   			log_out(ctx, _("%s: %s trying backup blocks...\n"),
# 1558|   				ctx->program_name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/et/init_et.c: scope_hint: In function ‘init_error_table’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/et/init_et.c:51:22: warning[-Wanalyzer-malloc-leak]: leak of ‘new_et’
#   49|   
#   50|       new_et->etl.next = _et_dynamic_list;
#   51|->     _et_dynamic_list = &new_et->etl;
#   52|       return 0;
#   53|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def42]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:345: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/qcow2.c:50: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/qcow2.c: scope_hint: In function ‘qcow2_write_raw_image’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:36:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/qcow2.c:229:26: note: in expansion of macro ‘ext2fs_be64_to_cpu’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:36:69: note: in definition of macro ‘ext2fs_be64_to_cpu’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:36:69: note: in definition of macro ‘ext2fs_be64_to_cpu’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/qcow2.c:229:26: note: in expansion of macro ‘ext2fs_be64_to_cpu’
#   34|   
#   35|   #define ext2fs_cpu_to_be64(x) ((__force __be64)ext2fs_swab64((__u64)(x)))
#   36|-> #define ext2fs_be64_to_cpu(x) ext2fs_swab64((__force __u64)(__be64)(x))
#   37|   #define ext2fs_cpu_to_be32(x) ((__force __be32)ext2fs_swab32((__u32)(x)))
#   38|   #define ext2fs_be32_to_cpu(x) ext2fs_swab32((__force __u32)(__be32)(x))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blkmap64_rb.c: scope_hint: In function ‘rb_find_first_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blkmap64_rb.c:898:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parent’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blkmap64_rb.c: scope_hint: In function ‘rb_find_first_set’
#  896|   	node = parent;
#  897|   	ext = node_to_extent(node);
#  898|-> 	if (ext->start < start) {
#  899|   		node = ext2fs_rb_next(node);
#  900|   		if (node == NULL)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_block_bitmap_checksum’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:259:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  257|   
#  258|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  259|-> 	csum = gdp->bg_block_bitmap_csum_lo;
#  260|   	if (EXT2_DESC_SIZE(fs->super) >= EXT4_BG_BLOCK_BITMAP_CSUM_HI_LOCATION)
#  261|   		csum |= ((__u32)gdp->bg_block_bitmap_csum_hi << 16);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_block_bitmap_loc’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:273:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  271|   
#  272|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  273|-> 	return gdp->bg_block_bitmap |
#  274|   		(ext2fs_has_feature_64bit(fs->super) ?
#  275|   		 (__u64)gdp->bg_block_bitmap_hi << 32 : 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_block_bitmap_loc_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:286:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  284|   
#  285|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  286|-> 	gdp->bg_block_bitmap = blk;
#  287|   	if (ext2fs_has_feature_64bit(fs->super))
#  288|   		gdp->bg_block_bitmap_hi = (__u64) blk >> 32;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_inode_bitmap_checksum’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:300:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  298|   
#  299|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  300|-> 	csum = gdp->bg_inode_bitmap_csum_lo;
#  301|   	if (EXT2_DESC_SIZE(fs->super) >= EXT4_BG_INODE_BITMAP_CSUM_HI_END)
#  302|   		csum |= ((__u32)gdp->bg_inode_bitmap_csum_hi << 16);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_inode_bitmap_loc’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:314:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  312|   
#  313|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  314|-> 	return gdp->bg_inode_bitmap |
#  315|   		(ext2fs_has_feature_64bit(fs->super) ?
#  316|   		 (__u64) gdp->bg_inode_bitmap_hi << 32 : 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def49]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_inode_bitmap_loc_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:327:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  325|   
#  326|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  327|-> 	gdp->bg_inode_bitmap = blk;
#  328|   	if (ext2fs_has_feature_64bit(fs->super))
#  329|   		gdp->bg_inode_bitmap_hi = (__u64) blk >> 32;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def50]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_inode_table_loc’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:340:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  338|   
#  339|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  340|-> 	return gdp->bg_inode_table |
#  341|   		(ext2fs_has_feature_64bit(fs->super) ?
#  342|   		 (__u64) gdp->bg_inode_table_hi << 32 : 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def51]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_inode_table_loc_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:353:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  351|   
#  352|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  353|-> 	gdp->bg_inode_table = blk;
#  354|   	if (ext2fs_has_feature_64bit(fs->super))
#  355|   		gdp->bg_inode_table_hi = (__u64) blk >> 32;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def52]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_free_blocks_count’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:366:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  364|   
#  365|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  366|-> 	return gdp->bg_free_blocks_count |
#  367|   		(ext2fs_has_feature_64bit(fs->super) ?
#  368|   		 (__u32) gdp->bg_free_blocks_count_hi << 16 : 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def53]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_free_blocks_count_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:379:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  377|   
#  378|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  379|-> 	gdp->bg_free_blocks_count = n;
#  380|   
#  381|   	if (ext2fs_has_feature_64bit(fs->super))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def54]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_free_inodes_count’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:393:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  391|   
#  392|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  393|-> 	return gdp->bg_free_inodes_count |
#  394|   		(ext2fs_has_feature_64bit(fs->super) ?
#  395|   		 (__u32) gdp->bg_free_inodes_count_hi << 16 : 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def55]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_free_inodes_count_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:406:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  404|   
#  405|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  406|-> 	gdp->bg_free_inodes_count = n;
#  407|   	if (ext2fs_has_feature_64bit(fs->super))
#  408|   		gdp->bg_free_inodes_count_hi = (__u32) n >> 16;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def56]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_used_dirs_count’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:419:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  417|   
#  418|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  419|-> 	return gdp->bg_used_dirs_count |
#  420|   		(ext2fs_has_feature_64bit(fs->super) ?
#  421|   		 (__u32) gdp->bg_used_dirs_count_hi << 16 : 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def57]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_used_dirs_count_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:432:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  430|   
#  431|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  432|-> 	gdp->bg_used_dirs_count = n;
#  433|   	if (ext2fs_has_feature_64bit(fs->super))
#  434|   		gdp->bg_used_dirs_count_hi = (__u32) n >> 16;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def58]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_itable_unused’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:445:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  443|   
#  444|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  445|-> 	return gdp->bg_itable_unused |
#  446|   		(ext2fs_has_feature_64bit(fs->super) ?
#  447|   		 (__u32) gdp->bg_itable_unused_hi << 16 : 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def59]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_itable_unused_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:458:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  456|   
#  457|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  458|-> 	gdp->bg_itable_unused = n;
#  459|   	if (ext2fs_has_feature_64bit(fs->super))
#  460|   		gdp->bg_itable_unused_hi = (__u32) n >> 16;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def60]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_flags’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:471:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  469|   
#  470|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  471|-> 	return gdp->bg_flags;
#  472|   }
#  473|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def61]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_flags_zap’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:482:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  480|   
#  481|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  482|-> 	gdp->bg_flags = 0;
#  483|   	return;
#  484|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def62]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_flags_test’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:494:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  492|   
#  493|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  494|-> 	return gdp->bg_flags & bg_flag;
#  495|   }
#  496|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def63]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_flags_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:505:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  503|   
#  504|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  505|-> 	gdp->bg_flags |= bg_flags;
#  506|   	return;
#  507|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def64]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_flags_clear’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:517:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  515|   
#  516|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  517|-> 	gdp->bg_flags &= ~bg_flags;
#  518|   	return;
#  519|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def65]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_checksum’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:529:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  527|   
#  528|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  529|-> 	return gdp->bg_checksum;
#  530|   }
#  531|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def66]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c: scope_hint: In function ‘ext2fs_bg_checksum_set’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blknum.c:540:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  538|   
#  539|   	gdp = ext4fs_group_desc(fs, fs->group_desc, group);
#  540|-> 	gdp->bg_checksum = checksum;
#  541|   	return;
#  542|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:2002:9: warning[-Wanalyzer-malloc-leak]: leak of ‘outdir.buf’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
# 2000|   	if (!pp)
# 2001|   		return EXT2_ET_NO_MEMORY;
# 2002|-> 	memcpy(ptr, &pp, sizeof (pp));
# 2003|   	return 0;
# 2004|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:2002:9: warning[-Wanalyzer-malloc-leak]: leak of ‘outdir.hashes’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/rehash.c: scope_hint: In function ‘ext2fs_get_array’
# 2000|   	if (!pp)
# 2001|   		return EXT2_ET_NO_MEMORY;
# 2002|-> 	memcpy(ptr, &pp, sizeof (pp));
# 2003|   	return 0;
# 2004|   }

Error: CPPCHECK_WARNING (CWE-401): [#def69]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:2003: error[memleak]: Memory leak: pp
# 2001|   		return EXT2_ET_NO_MEMORY;
# 2002|   	memcpy(ptr, &pp, sizeof (pp));
# 2003|-> 	return 0;
# 2004|   }
# 2005|   

Error: CPPCHECK_WARNING (CWE-401): [#def70]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:2015: error[memleak]: Memory leak: pp
# 2013|   	memset(pp, 0, size);
# 2014|   	memcpy(ptr, &pp, sizeof(pp));
# 2015|-> 	return 0;
# 2016|   }
# 2017|   

Error: GCC_ANALYZER_WARNING (CWE-121): [#def71]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:2045:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_release’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c:615:9: note: in expansion of macro ‘EXT2_CHECK_MAGIC’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_release’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_release’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:2045:9: note: write of 8 bytes to beyond the end of ‘dx_info’
# 2043|   	free(p);
# 2044|   	p = 0;
# 2045|-> 	memcpy(ptr, &p, sizeof(p));
# 2046|   	return 0;
# 2047|   }

Error: CPPCHECK_WARNING (CWE-401): [#def72]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:2060: error[memleakOnRealloc]: Common realloc mistake: 'p' nulled but not freed upon failure
# 2058|   	 * with C99 strict type aliasing rules. */
# 2059|   	memcpy(&p, ptr, sizeof(p));
# 2060|-> 	p = realloc(p, size);
# 2061|   	if (!p)
# 2062|   		return EXT2_ET_NO_MEMORY;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:2063:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/blkmap64_ba.c: scope_hint: In function ‘ba_resize_bmap’
# 2061|   	if (!p)
# 2062|   		return EXT2_ET_NO_MEMORY;
# 2063|-> 	memcpy(ptr, &p, sizeof(p));
# 2064|   	return 0;
# 2065|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def74]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:345: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fsP.h:16: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext_attr.c:26: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext_attr.c: scope_hint: In function ‘ext2fs_ext_attr_hash_entry’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext_attr.c:68:51: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘value’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:31:56: note: in definition of macro ‘ext2fs_le32_to_cpu’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext_attr.c:1708:9: note: in expansion of macro ‘EXT2_CHECK_MAGIC’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext_attr.c: scope_hint: In function ‘ext2fs_ext_attr_hash_entry’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext_attr.c:757:9: note: in expansion of macro ‘EXT2_CHECK_MAGIC’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext_attr.c: scope_hint: In function ‘ext2fs_ext_attr_hash_entry’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:31:56: note: in definition of macro ‘ext2fs_le32_to_cpu’
#   66|   			hash = (hash << VALUE_HASH_SHIFT) ^
#   67|   			       (hash >> (8*sizeof(hash) - VALUE_HASH_SHIFT)) ^
#   68|-> 			       ext2fs_le32_to_cpu(*value++);
#   69|   		}
#   70|   	}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def75]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inline_data.c: scope_hint: In function ‘ext2fs_inline_data_convert_dir’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inline_data.c:318:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ibuf + 4’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inline_data.c:20: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inline_data.c:438:9: note: in expansion of macro ‘EXT2_CHECK_MAGIC’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inline_data.c: scope_hint: In function ‘ext2fs_inline_data_convert_dir’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:577:36: note: in definition of macro ‘LINUX_S_ISDIR’
#  316|   	offset = EXT2_DIR_REC_LEN(1) + EXT2_DIR_REC_LEN(2);
#  317|   	dir = (struct ext2_dir_entry *) (bbuf + offset);
#  318|-> 	memcpy(bbuf + offset, ibuf + EXT4_INLINE_DATA_DOTDOT_SIZE,
#  319|   	       size - EXT4_INLINE_DATA_DOTDOT_SIZE);
#  320|   	size += EXT2_DIR_REC_LEN(1) + EXT2_DIR_REC_LEN(2) -

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inode.c: scope_hint: In function ‘ext2fs_create_inode_cache’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inode.c:135:20: warning[-Wanalyzer-malloc-leak]: leak of ‘*fs.icache’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fsP.h:16: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inode.c:30: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inode.c:1105:9: note: in expansion of macro ‘EXT2_CHECK_MAGIC’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inode.c: scope_hint: In function ‘ext2fs_create_inode_cache’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inode.c:772:9: note: in expansion of macro ‘EXT2_CHECK_MAGIC’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2_fs.h:958:1: note: in expansion of macro ‘EXT4_FEATURE_INCOMPAT_FUNCS’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inode.c: scope_hint: In function ‘ext2fs_create_inode_cache’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inode.c: scope_hint: In function ‘ext2fs_create_inode_cache’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/inode.c: scope_hint: In function ‘ext2fs_create_inode_cache’
#  133|   errout:
#  134|   	ext2fs_free_inode_cache(fs->icache);
#  135|-> 	fs->icache = 0;
#  136|   	return retval;
#  137|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/kernel-list.h:43:20: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(32)’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c: scope_hint: In function ‘move_block’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c: scope_hint: In function ‘move_block’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c: scope_hint: In function ‘move_block’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c: scope_hint: In function ‘move_block’
#   41|   	new->next = next;
#   42|   	new->prev = prev;
#   43|-> 	prev->next = new;
#   44|   }
#   45|   

Error: GCC_ANALYZER_WARNING (CWE-416): [#def78]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/kernel-list.h:78:9: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘*hash_list.next’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/revoke.c: scope_hint: In function ‘jbd2_journal_clear_revoke’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/revoke.c: scope_hint: In function ‘jbd2_journal_clear_revoke’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/revoke.c: scope_hint: In function ‘jbd2_journal_clear_revoke’
#   76|   static __inline__ void list_del(struct list_head *entry)
#   77|   {
#   78|-> 	__list_del(entry->prev, entry->next);
#   79|   }
#   80|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def79]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_release’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c:52:40: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c:615:9: note: in expansion of macro ‘EXT2_CHECK_MAGIC’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_release’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_release’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c:52:40: note: read of 8 bytes from after the end of ‘dx_info’
#   50|   
#   51|   	for (level = 0; level < info->levels; level++) {
#   52|-> 		if (info->frames[level].buf == NULL)
#   53|   			break;
#   54|   		ext2fs_free_mem(&(info->frames[level].buf));

Error: GCC_ANALYZER_WARNING (CWE-126): [#def80]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:345: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_link’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c:578:68: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:31:56: note: in definition of macro ‘ext2fs_le32_to_cpu’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c:615:9: note: in expansion of macro ‘EXT2_CHECK_MAGIC’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_link’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_link’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:33:56: note: in definition of macro ‘ext2fs_le16_to_cpu’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_link’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c: scope_hint: In function ‘dx_link’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:31:56: note: in definition of macro ‘ext2fs_le32_to_cpu’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:31:56: note: in definition of macro ‘ext2fs_le32_to_cpu’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/link.c:578:68: note: read of 8 bytes from after the end of ‘dx_info’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/bitops.h:31:56: note: in definition of macro ‘ext2fs_le32_to_cpu’
#  576|   
#  577|   	retval = add_dirent_to_buf(fs,
#  578|-> 		ext2fs_le32_to_cpu(dx_info.frames[dx_info.levels-1].at->block) & 0x0fffffff,
#  579|   		blockbuf, dir, diri, name, ino, flags, &leaf_pblk);
#  580|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/rbtree.h:176:18: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(56)’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/encrypted_files.c: scope_hint: In function ‘get_encryption_policy_id’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/e2fsck/encrypted_files.c: scope_hint: In function ‘get_encryption_policy_id’
#  174|   	node->rb_left = node->rb_right = NULL;
#  175|   
#  176|-> 	*rb_link = node;
#  177|   }
#  178|   

Error: GCC_ANALYZER_WARNING (CWE-465): [#def82]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c: scope_hint: In function ‘ext2fs_tdb_transaction_cancel’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:164:30: warning[-Wanalyzer-deref-before-check]: check of ‘*tdb.transaction’ for NULL after already dereferencing it
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:1753:9: note: in expansion of macro ‘SAFE_FREE’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:115: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:4038:5: note: in expansion of macro ‘tdb_close’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:4044:17: note: in expansion of macro ‘tdb_transaction_cancel’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:4044:17: note: in expansion of macro ‘tdb_transaction_cancel’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:1706:5: note: in expansion of macro ‘tdb_transaction_cancel’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:164:32: note: in definition of macro ‘SAFE_FREE’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:1752:9: note: in expansion of macro ‘SAFE_FREE’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:164:32: note: in definition of macro ‘SAFE_FREE’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:1753:9: note: in expansion of macro ‘SAFE_FREE’
#  162|   /* free memory if the pointer is valid and zero the pointer */
#  163|   #ifndef SAFE_FREE
#  164|-> #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); (x)=NULL;} } while(0)
#  165|   #endif
#  166|   

Error: GCC_ANALYZER_WARNING: [#def83]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c: scope_hint: In function ‘tdb_new_database’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:3778:13: warning[-Wanalyzer-fd-use-without-check]: ‘write’ on possibly invalid file descriptor ‘-1’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:3830:21: note: in expansion of macro ‘tdb_open_ex’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c: scope_hint: In function ‘tdb_new_database’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:170:21: note: in expansion of macro ‘DOCONV’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:3774:9: note: in expansion of macro ‘CONVERT’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/tdb.c:3774:9: note: in expansion of macro ‘CONVERT’
# 3776|   	/* Don't endian-convert the magic food! */
# 3777|   	memcpy(newdb->magic_food, TDB_MAGIC_FOOD, strlen(TDB_MAGIC_FOOD)+1);
# 3778|-> 	if (write(tdb->fd, newdb, size) != size) {
# 3779|   		ret = -1;
# 3780|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-465): [#def84]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ss/help.c: scope_hint: In function ‘ss_add_info_dir’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ss/help.c:153:8: warning[-Wanalyzer-deref-before-check]: check of ‘dirs’ for NULL after already dereferencing it
#  151|       dirs = (char **)realloc((char *)dirs,
#  152|   			    (unsigned)(n_dirs + 2)*sizeof(char *));
#  153|->     if (dirs == (char **)NULL) {
#  154|   	*code_ptr = ENOMEM;
#  155|   	return;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def85]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ss/pager.c: scope_hint: In function ‘ss_pager_create’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ss/pager.c:79:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘filedes[0]’
#   77|   
#   78|   	if (pipe(filedes) != 0)
#   79|-> 		return(-1);
#   80|   
#   81|   	switch(fork()) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def86]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ss/pager.c:79:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘filedes[1]’
#   77|   
#   78|   	if (pipe(filedes) != 0)
#   79|-> 		return(-1);
#   80|   
#   81|   	switch(fork()) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def87]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ss/pager.c:88:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(filedes[0], 0)’
#   86|   		 * Child; dup read half to 0, close all but 0, 1, and 2
#   87|   		 */
#   88|-> 		if (dup2(filedes[0], 0) == -1)
#   89|   			exit(1);
#   90|   		ss_page_stdin();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/support/profile.c: scope_hint: In function ‘profile_update_file’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/support/profile.c:542:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/support/profile.c:62: included_from: Included from here.
#  540|   
#  541|   	if (prf->flags & PROFILE_FILE_NO_RELOAD)
#  542|-> 		return 0;
#  543|   
#  544|   #ifdef HAVE_STAT

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/support/profile.c:542:24: warning[-Wanalyzer-malloc-leak]: leak of ‘state.root_section’
#  540|   
#  541|   	if (prf->flags & PROFILE_FILE_NO_RELOAD)
#  542|-> 		return 0;
#  543|   
#  544|   #ifdef HAVE_STAT

Error: GCC_ANALYZER_WARNING (CWE-457): [#def90]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/badblocks.c: scope_hint: In function ‘test_nd’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/badblocks.c:939:79: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>.block’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/badblocks.c:50: included_from: Included from here.
#  937|   					if (used2 >= num_saved)
#  938|   						break;
#  939|-> 					currently_testing = test_record[used2].block;
#  940|   					try = test_record[used2].num;
#  941|   					used2++;

Error: GCC_ANALYZER_WARNING (CWE-127): [#def91]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/create_inode.c: scope_hint: In function ‘try_fiemap_copy’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/create_inode.c:568:26: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/create_inode.c:17: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/create_inode.c:34: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:576:36: note: in definition of macro ‘LINUX_S_ISREG’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/create_inode.c: scope_hint: In function ‘try_fiemap_copy’
#  566|   		ext--;
#  567|   		/* Record file's logical offset this time */
#  568|-> 		pos = ext->fe_logical + ext->fe_length;
#  569|   		/*
#  570|   		 * If fm_extents array has been filled and

Error: GCC_ANALYZER_WARNING (CWE-127): [#def92]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/create_inode.c:568:44: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/lib/ext2fs/ext2fs.h:576:36: note: in definition of macro ‘LINUX_S_ISREG’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/create_inode.c: scope_hint: In function ‘try_fiemap_copy’
#  566|   		ext--;
#  567|   		/* Record file's logical offset this time */
#  568|-> 		pos = ext->fe_logical + ext->fe_length;
#  569|   		/*
#  570|   		 * If fm_extents array has been filled and

Error: GCC_ANALYZER_WARNING (CWE-688): [#def93]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/create_inode.c: scope_hint: In function ‘path_append’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/create_inode.c:747:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘file_info.path’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null
#  745|   		target->path = p;
#  746|   	}
#  747|-> 	target->path_len += sprintf(target->path + target->path_len, "/%s",
#  748|   				    file);
#  749|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def94]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/e2freefrag.c: scope_hint: In function ‘scan_online’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/e2freefrag.c:195:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&mntpoint, 0)’
#  193|   
#  194|   	fsmap = malloc(fsmap_sizeof(FSMAP_EXTENTS));
#  195|-> 	if (!fsmap) {
#  196|   		com_err(fs->device_name, errno, "while allocating memory");
#  197|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-686): [#def95]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/e4crypt.c: scope_hint: In function ‘keyctl’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/e4crypt.c:87:14: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘long unsigned int’ but received ‘void *’ for variadic argument 1 of ‘va’
#   85|   
#   86|   	va_start(va, cmd);
#   87|-> 	arg2 = va_arg(va, unsigned long);
#   88|   	arg3 = va_arg(va, unsigned long);
#   89|   	arg4 = va_arg(va, unsigned long);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/e4crypt.c: scope_hint: In function ‘parse_salt’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/e4crypt.c:207:12: warning[-Wanalyzer-malloc-leak]: leak of ‘salt_buf’
#  205|   static void add_salt(unsigned char *salt, size_t salt_len)
#  206|   {
#  207|-> 	if (find_by_salt(salt, salt_len))
#  208|   		return;
#  209|   	if (num_salt >= max_salt) {

Error: GCC_ANALYZER_WARNING (CWE-126): [#def97]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/filefrag.c: scope_hint: In function ‘filefrag_fiemap’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/filefrag.c:315:50: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/filefrag.c:315:50: note: read of 8 bytes from after the end of ‘buf’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/filefrag.c:315:50: note: valid subscripts for ‘buf’ are ‘[0]’ to ‘[2047]’
#  313|   		}
#  314|   
#  315|-> 		fiemap->fm_start = (fm_ext[i - 1].fe_logical +
#  316|   				    fm_ext[i - 1].fe_length);
#  317|   	} while (last == 0);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def98]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/filefrag.c:316:50: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/filefrag.c:316:50: note: read of 8 bytes from after the end of ‘buf’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/filefrag.c:316:50: note: valid subscripts for ‘buf’ are ‘[0]’ to ‘[2047]’
#  314|   
#  315|   		fiemap->fm_start = (fm_ext[i - 1].fe_logical +
#  316|-> 				    fm_ext[i - 1].fe_length);
#  317|   	} while (last == 0);
#  318|   

Error: GCC_ANALYZER_WARNING (CWE-121): [#def99]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/mklost+found.c: scope_hint: In function ‘main’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/mklost+found.c:61:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/mklost+found.c:61:17: note: write of 246 bytes to beyond the end of ‘name’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/mklost+found.c:61:17: note: valid subscripts for ‘name’ are ‘[0]’ to ‘[256]’
#   59|   	memset (name, 'x', 246);
#   60|   	do {
#   61|-> 		sprintf (name + 246, "%08d", i);
#   62|   		strcpy (path, LPF);
#   63|   		strcat (path, "/");

Error: GCC_ANALYZER_WARNING (CWE-121): [#def100]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/mklost+found.c:77:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/mklost+found.c:77:17: note: write of 246 bytes to beyond the end of ‘name’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/mklost+found.c:77:17: note: valid subscripts for ‘name’ are ‘[0]’ to ‘[256]’
#   75|   	} while (st.st_size <= (EXT2_NDIR_BLOCKS - 1) * st.st_blksize);
#   76|   	for (j = 0; j < i; j++) {
#   77|-> 		sprintf (name + 246, "%08d", j);
#   78|   		strcpy (path, LPF);
#   79|   		strcat (path, "/");

Error: GCC_ANALYZER_WARNING (CWE-122): [#def101]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c: scope_hint: In function ‘expand_inode_table’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c:2808:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c:63: included_from: Included from here.
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c:2780:24: note: in expansion of macro ‘EXT2_INODE_SIZE’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c:2783:41: note: in expansion of macro ‘EXT2_INODES_PER_GROUP’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c: scope_hint: In function ‘expand_inode_table’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c: scope_hint: In function ‘expand_inode_table’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/misc/tune2fs.c:2808:25: note: write of 128 bytes to beyond the end of the region
# 2806|   
# 2807|   		for (j = 0; j < EXT2_INODES_PER_GROUP(fs->super); j++) {
# 2808|-> 			memcpy(new_itable, old_itable, old_ino_size);
# 2809|   
# 2810|   			memset(new_itable+old_ino_size, 0,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def102]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/tests/progs/test_icount.c: scope_hint: In function ‘source_file’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/tests/progs/test_icount.c:316:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
#  314|   	if (f != stdin)
#  315|   		fclose(f);
#  316|-> 	return exit_status;
#  317|   }
#  318|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/tests/progs/test_icount.c:316:16: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
#  314|   	if (f != stdin)
#  315|   		fclose(f);
#  316|-> 	return exit_status;
#  317|   }
#  318|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/util/subst.c: scope_hint: In function ‘main’
e2fsprogs-1.47.1-build/e2fsprogs-1.47.1/util/subst.c:390:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(outfn, 0)’
#  388|   
#  389|   		fd = open(outfn, O_RDONLY);
#  390|-> 		if (fd > 0) {
#  391|   			/* save the original atime, if possible */
#  392|   			if (fstat(fd, &stbuf) == 0) {

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-112.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namee2fsprogs-1.47.1-6.fc42
store-results-to/tmp/tmpg7ooxkjc/e2fsprogs-1.47.1-6.fc42.tar.xz
time-created2024-11-12 23:43:50
time-finished2024-11-12 23:46:57
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpg7ooxkjc/e2fsprogs-1.47.1-6.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpg7ooxkjc/e2fsprogs-1.47.1-6.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9