git-2.45.2-1.fc41

List of Defects

Error: CLANG_WARNING: [#def1]
git-2.45.2-build/git-2.45.2/abspath.c:275:3: warning[deadcode.DeadStores]: Value stored to 'pfx_len' is never read
#  273|   		; /* nothing to prefix */
#  274|   	else if (is_absolute_path(arg))
#  275|-> 		pfx_len = 0;
#  276|   	else
#  277|   		strbuf_add(&path, pfx, pfx_len);

Error: CLANG_WARNING: [#def2]
git-2.45.2-build/git-2.45.2/add-interactive.c:1173:2: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 1171|   		warning(_("could not refresh index"));
# 1172|   
# 1173|-> 	res = run_status(&s, ps, &files, &opts);
# 1174|   
# 1175|   	for (;;) {

Error: CLANG_WARNING: [#def3]
git-2.45.2-build/git-2.45.2/add-interactive.c:1191:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 1189|   
# 1190|   		if (util)
# 1191|-> 			res = util->command(&s, ps, &files, &opts);
# 1192|   	}
# 1193|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
git-2.45.2-build/git-2.45.2/add-patch.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/add-patch.c: scope_hint: In function ‘parse_diff’
git-2.45.2-build/git-2.45.2/add-patch.c:518:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘file_diff’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1233:41: note: in definition of macro ‘ALLOC_GROW_BY’
git-2.45.2-build/git-2.45.2/add-patch.c: scope_hint: In function ‘parse_diff’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1233:41: note: in definition of macro ‘ALLOC_GROW_BY’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1233:41: note: in definition of macro ‘ALLOC_GROW_BY’
#  516|   				hunk->splittable_into++;
#  517|   
#  518|-> 			ALLOC_GROW_BY(file_diff->hunk, file_diff->hunk_nr, 1,
#  519|   				   file_diff->hunk_alloc);
#  520|   			hunk = file_diff->hunk + file_diff->hunk_nr - 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
git-2.45.2-build/git-2.45.2/add-patch.c:595:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘hunk’
git-2.45.2-build/git-2.45.2/add-patch.c: scope_hint: In function ‘parse_diff’
#  593|   
#  594|   		p = eol == pend ? pend : eol + 1;
#  595|-> 		hunk->end = p - plain->buf;
#  596|   
#  597|   		if (colored) {

Error: CLANG_WARNING: [#def6]
git-2.45.2-build/git-2.45.2/add-patch.c:598:24: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  596|   
#  597|   		if (colored) {
#  598|-> 			char *colored_eol = memchr(colored_p, '\n',
#  599|   						   colored_pend - colored_p);
#  600|   			if (colored_eol)

Error: CLANG_WARNING: [#def7]
git-2.45.2-build/git-2.45.2/add-patch.c:1672:46: warning[deadcode.DeadStores]: Value stored to 'eol' during its initialization is never read
# 1670|   			rendered_hunk_index = -1;
# 1671|   		} else {
# 1672|-> 			const char *p = _(help_patch_remainder), *eol = p;
# 1673|   
# 1674|   			color_fprintf(stdout, s->s.help_color, "%s",

Error: CLANG_WARNING: [#def8]
git-2.45.2-build/git-2.45.2/apply.c:2999:3: warning[core.NullDereference]: Dereference of null pointer
# 2997|   		strbuf_setlen(&newlines, newlines.len - 1);
# 2998|   		preimage.line_allocated[preimage.nr - 1].len--;
# 2999|-> 		postimage.line_allocated[postimage.nr - 1].len--;
# 3000|   	}
# 3001|   

Error: GCC_ANALYZER_WARNING: [#def9]
git-2.45.2-build/git-2.45.2/archive-tar.c: scope_hint: In function ‘write_tar_filter_archive’
git-2.45.2-build/git-2.45.2/archive-tar.c:512:13: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
#  510|   		die_errno(_("unable to start '%s' filter"), cmd.buf);
#  511|   	close(1);
#  512|-> 	if (dup2(filter.in, 1) < 0)
#  513|   		die_errno(_("unable to redirect descriptor"));
#  514|   	close(filter.in);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def10]
git-2.45.2-build/git-2.45.2/archive-tar.c:518:9: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘1’
#  516|   	r = write_tar_archive(ar, args);
#  517|   
#  518|-> 	close(1);
#  519|   	if (finish_command(&filter) != 0)
#  520|   		die(_("'%s' filter reported error"), cmd.buf);

Error: CLANG_WARNING: [#def11]
git-2.45.2-build/git-2.45.2/archive.c:750:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  748|   	args.prefix = prefix;
#  749|   	string_list_init_dup(&args.extra_files);
#  750|-> 	argc = parse_archive_args(argc, argv, &ar, &args, name_hint, remote);
#  751|   	if (!startup_info->have_repository) {
#  752|   		/*

Error: CLANG_WARNING: [#def12]
git-2.45.2-build/git-2.45.2/attr.c:590:17: warning[deadcode.DeadStores]: Although the value stored to 'param' is used in the enclosing expression, the value is never actually read from 'param'
#  588|   
#  589|   	va_start(params, one);
#  590|-> 	for (cnt = 1; (param = va_arg(params, const char *)) != NULL; cnt++)
#  591|   		;
#  592|   	va_end(params);

Error: CLANG_WARNING: [#def13]
git-2.45.2-build/git-2.45.2/attr.c:1011:11: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer (loaded from variable 'info')
# 1009|   	 */
# 1010|   	info = *stack;
# 1011|-> 	*stack = info->prev;
# 1012|   
# 1013|   	/*

Error: CLANG_WARNING: [#def14]
git-2.45.2-build/git-2.45.2/attr.c:1019:9: warning[core.NullDereference]: Access to field 'origin' results in a dereference of a null pointer
# 1017|   	 * one (whose origin is NULL) without popping it.
# 1018|   	 */
# 1019|-> 	while ((*stack)->origin) {
# 1020|   		int namelen = (*stack)->originlen;
# 1021|   		struct attr_stack *elem;

Error: CLANG_WARNING: [#def15]
git-2.45.2-build/git-2.45.2/bisect.c:437:15: warning[core.NullDereference]: Access to field 'item' results in a dereference of a null pointer (loaded from variable 'list')
#  435|   	if (best) {
#  436|   		if (!(bisect_flags & FIND_BISECTION_ALL)) {
#  437|-> 			list->item = best->item;
#  438|   			free_commit_list(list->next);
#  439|   			best = list;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
git-2.45.2-build/git-2.45.2/blame.c: scope_hint: In function ‘setup_scoreboard’
git-2.45.2-build/git-2.45.2/blame.c:2839:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’
git-2.45.2-build/git-2.45.2/blame.c: scope_hint: In function ‘setup_scoreboard’
# 2837|   
# 2838|   		sb->revs->children.name = "children";
# 2839|-> 		while (c->parents &&
# 2840|   		       !oideq(&c->object.oid, &sb->final->object.oid)) {
# 2841|   			struct commit_list *l = xcalloc(1, sizeof(*l));

Error: CLANG_WARNING: [#def17]
git-2.45.2-build/git-2.45.2/branch.c:169:12: warning[core.NullDereference]: Dereference of null pointer
#  167|   				_("branch '%s' set up to track '%s' by rebasing.") :
#  168|   				_("branch '%s' set up to track '%s'."),
#  169|-> 				local, friendly_ref_names.items[0].string);
#  170|   		} else {
#  171|   			printf_ln(_("branch '%s' set up to track:"), local);

Error: CLANG_WARNING: [#def18]
git-2.45.2-build/git-2.45.2/builtin/add.c:190:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  188|   	rev.diffopt.context = 7;
#  189|   
#  190|-> 	argc = setup_revisions(argc, argv, &rev, NULL);
#  191|   	rev.diffopt.output_format = DIFF_FORMAT_PATCH;
#  192|   	rev.diffopt.use_color = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
git-2.45.2-build/git-2.45.2/builtin/archive.c: scope_hint: In function ‘create_output_file’
git-2.45.2-build/git-2.45.2/builtin/archive.c:17:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(xopen(output_file, 577, 438), 1)’
#   15|   	int output_fd = xopen(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666);
#   16|   	if (output_fd != 1) {
#   17|-> 		if (dup2(output_fd, 1) < 0)
#   18|   			die_errno(_("could not redirect output"));
#   19|   		else

Error: CLANG_WARNING: [#def20]
git-2.45.2-build/git-2.45.2/builtin/bundle.c:139:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  137|   	const char *name;
#  138|   
#  139|-> 	argc = parse_options_cmd_bundle(argc, argv, prefix,
#  140|   			builtin_bundle_verify_usage, options, &bundle_file);
#  141|   	/* bundle internals use argv[1] as further parameters */

Error: CLANG_WARNING: [#def21]
git-2.45.2-build/git-2.45.2/builtin/cat-file.c:155:28: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  153|   			die("git cat-file: could not get object info");
#  154|   
#  155|-> 		if (use_mailmap && (type == OBJ_COMMIT || type == OBJ_TAG)) {
#  156|   			size_t s = size;
#  157|   			buf = replace_idents_using_mailmap(buf, &s);

Error: CLANG_WARNING: [#def22]
git-2.45.2-build/git-2.45.2/builtin/clone.c:1077:12: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1075|   		if (dest_exists)
# 1076|   			junk_work_tree_flags |= REMOVE_DIR_KEEP_TOPLEVEL;
# 1077|-> 		else if (mkdir(work_tree, 0777))
# 1078|   			die_errno(_("could not create work tree dir '%s'"),
# 1079|   				  work_tree);

Error: CLANG_WARNING: [#def23]
git-2.45.2-build/git-2.45.2/builtin/commit.c:1078:20: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
# 1076|   	}
# 1077|   
# 1078|-> 	if (!no_verify && invoked_hook) {
# 1079|   		/*
# 1080|   		 * Re-read the index as the pre-commit-commit hook was invoked

Error: CLANG_WARNING: [#def24]
git-2.45.2-build/git-2.45.2/builtin/commit.c:1568:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 1566|   
# 1567|   	status_init_config(&s, git_status_config);
# 1568|-> 	argc = parse_options(argc, argv, prefix,
# 1569|   			     builtin_status_options,
# 1570|   			     builtin_status_usage, 0);

Error: CLANG_WARNING: [#def25]
git-2.45.2-build/git-2.45.2/builtin/commit.c:1751:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 1749|   	}
# 1750|   	verbose = -1; /* unspecified */
# 1751|-> 	argc = parse_and_validate_options(argc, argv, builtin_commit_options,
# 1752|   					  builtin_commit_usage,
# 1753|   					  prefix, current_head, &s);

Error: CLANG_WARNING: [#def26]
git-2.45.2-build/git-2.45.2/builtin/credential-cache--daemon.c:294:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  292|   	git_config_get_bool("credentialcache.ignoresighup", &ignore_sighup);
#  293|   
#  294|-> 	argc = parse_options(argc, argv, prefix, options, usage, 0);
#  295|   	socket_path = argv[0];
#  296|   

Error: CLANG_WARNING: [#def27]
git-2.45.2-build/git-2.45.2/builtin/diagnose.c:35:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#   33|   	};
#   34|   
#   35|-> 	argc = parse_options(argc, argv, prefix, diagnose_options,
#   36|   			     diagnose_usage, 0);
#   37|   

Error: CLANG_WARNING: [#def28]
git-2.45.2-build/git-2.45.2/builtin/diff-files.c:43:2: warning[deadcode.DeadStores]: Value stored to 'prefix' is never read
#   41|   	rev.diffopt.ita_invisible_in_index = 1;
#   42|   
#   43|-> 	prefix = precompose_argv_prefix(argc, argv, prefix);
#   44|   
#   45|   	argc = setup_revisions(argc, argv, &rev, NULL);

Error: CLANG_WARNING: [#def29]
git-2.45.2-build/git-2.45.2/builtin/diff-index.c:30:2: warning[deadcode.DeadStores]: Value stored to 'prefix' is never read
#   28|   	repo_init_revisions(the_repository, &rev, prefix);
#   29|   	rev.abbrev = 0;
#   30|-> 	prefix = precompose_argv_prefix(argc, argv, prefix);
#   31|   
#   32|   	/*

Error: CLANG_WARNING: [#def30]
git-2.45.2-build/git-2.45.2/builtin/diff-tree.c:138:2: warning[deadcode.DeadStores]: Value stored to 'prefix' is never read
#  136|   	s_r_opt.tweak = diff_tree_tweak_rev;
#  137|   
#  138|-> 	prefix = precompose_argv_prefix(argc, argv, prefix);
#  139|   	argc = setup_revisions(argc, argv, opt, &s_r_opt);
#  140|   

Error: CLANG_WARNING: [#def31]
git-2.45.2-build/git-2.45.2/builtin/difftool.c:729:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  727|   	symlinks = has_symlinks;
#  728|   
#  729|-> 	argc = parse_options(argc, argv, prefix, builtin_difftool_options,
#  730|   			     builtin_difftool_usage, PARSE_OPT_KEEP_UNKNOWN_OPT |
#  731|   			     PARSE_OPT_KEEP_DASHDASH);

Error: CLANG_WARNING: [#def32]
git-2.45.2-build/git-2.45.2/builtin/fast-import.c:1918:2: warning[deadcode.DeadStores]: Value stored to 'num' is never read
# 1916|   	errno = 0;
# 1917|   
# 1918|-> 	num = strtoul(src, &endp, 10);
# 1919|   	/*
# 1920|   	 * NEEDSWORK: perhaps check for reasonable values? For example, we

Error: CLANG_WARNING: [#def33]
git-2.45.2-build/git-2.45.2/builtin/fast-import.c:2042:22: warning[core.NullDereference]: Access to field 'active_next_branch' results in a dereference of a null pointer (loaded from variable 'e')
# 2040|   		} else {
# 2041|   			e = active_branches;
# 2042|-> 			active_branches = e->active_next_branch;
# 2043|   		}
# 2044|   		e->active = 0;

Error: CLANG_WARNING: [#def34]
git-2.45.2-build/git-2.45.2/builtin/fetch.c:544:19: warning[core.NullDereference]: Access to field 'nr' results in a dereference of a null pointer (loaded from variable 'fetch_refspec')
#  542|   			fetch_refspec = &remote->fetch;
#  543|   
#  544|-> 		for (i = 0; i < fetch_refspec->nr; i++)
#  545|   			get_fetch_map(ref_map, &fetch_refspec->items[i], &oref_tail, 1);
#  546|   	} else if (refmap.nr) {

Error: CLANG_WARNING: [#def35]
git-2.45.2-build/git-2.45.2/builtin/index-pack.c:1513:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1511|   			    ext, *final_name);
# 1512|   	} else if (make_read_only_if_same) {
# 1513|-> 		chmod(*final_name, 0444);
# 1514|   	}
# 1515|   }

Error: CLANG_WARNING: [#def36]
git-2.45.2-build/git-2.45.2/builtin/index-pack.c:1687:4: warning[core.NullDereference]: Array access (from variable 'chain_histogram') results in a null pointer dereference
# 1685|   
# 1686|   		if (is_delta_type(obj->type))
# 1687|-> 			chain_histogram[obj_stat[i].delta_depth - 1]++;
# 1688|   		if (stat_only)
# 1689|   			continue;

Error: CLANG_WARNING: [#def37]
git-2.45.2-build/git-2.45.2/builtin/index-pack.c:1709:8: warning[core.NullDereference]: Array access (from variable 'chain_histogram') results in a null pointer dereference
# 1707|   			  baseobjects);
# 1708|   	for (i = 0; i < deepest_delta; i++) {
# 1709|-> 		if (!chain_histogram[i])
# 1710|   			continue;
# 1711|   		printf_ln(Q_("chain length = %d: %lu object",

Error: GCC_ANALYZER_WARNING (CWE-688): [#def38]
git-2.45.2-build/git-2.45.2/builtin/interpret-trailers.c: scope_hint: In function ‘create_in_place_tempfile’
git-2.45.2-build/git-2.45.2/builtin/interpret-trailers.c:104:13: warning[-Wanalyzer-null-argument]: use of NULL ‘file’ where non-null expected
/usr/include/features.h:511: included_from: Included from here.
/usr/include/unistd.h:25: included_from: Included from here.
git-2.45.2-build/git-2.45.2/git-compat-util.h:233: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/interpret-trailers.c:8: included_from: Included from here.
/usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null
#  102|   	FILE *outfile;
#  103|   
#  104|-> 	if (stat(file, &st))
#  105|   		die_errno(_("could not stat %s"), file);
#  106|   	if (!S_ISREG(st.st_mode))

Error: CLANG_WARNING: [#def39]
git-2.45.2-build/git-2.45.2/builtin/ls-files.c:655:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  653|   		die("index file corrupt");
#  654|   
#  655|-> 	argc = parse_options(argc, argv, prefix, builtin_ls_files_options,
#  656|   			ls_files_usage, 0);
#  657|   	pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");

Error: CLANG_WARNING: [#def40]
git-2.45.2-build/git-2.45.2/builtin/merge.c:226:38: warning[core.NullDereference]: Array access (from variable 'use_strategies') results in a null pointer dereference
#  224|   {
#  225|   	ALLOC_GROW(use_strategies, use_strategies_nr + 1, use_strategies_alloc);
#  226|-> 	use_strategies[use_strategies_nr++] = s;
#  227|   }
#  228|   

Error: CLANG_WARNING: [#def41]
git-2.45.2-build/git-2.45.2/builtin/merge.c:907:2: warning[deadcode.DeadStores]: Value stored to 'pptr' is never read
#  905|   	printf(_("Wonderful.\n"));
#  906|   	pptr = commit_list_append(head, pptr);
#  907|-> 	pptr = commit_list_append(remoteheads->item, pptr);
#  908|   	prepare_to_commit(remoteheads);
#  909|   	if (commit_tree(merge_msg.buf, merge_msg.len, &result_tree, parents,

Error: CLANG_WARNING: [#def42]
git-2.45.2-build/git-2.45.2/builtin/merge.c:1509:7: warning[core.NullDereference]: Array access (from variable 'use_strategies') results in a null pointer dereference
# 1507|   
# 1508|   	for (i = 0; i < use_strategies_nr; i++) {
# 1509|-> 		if (use_strategies[i]->attr & NO_FAST_FORWARD)
# 1510|   			fast_forward = FF_NO;
# 1511|   		if (use_strategies[i]->attr & NO_TRIVIAL)

Error: CLANG_WARNING: [#def43]
git-2.45.2-build/git-2.45.2/builtin/mktag.c:87:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#   85|   	struct object_id result;
#   86|   
#   87|-> 	argc = parse_options(argc, argv, prefix,
#   88|   			     builtin_mktag_options,
#   89|   			     builtin_mktag_usage, 0);

Error: CLANG_WARNING: [#def44]
git-2.45.2-build/git-2.45.2/builtin/mktree.c:170:2: warning[deadcode.DeadStores]: Value stored to 'ac' is never read
#  168|   	};
#  169|   
#  170|-> 	ac = parse_options(ac, av, prefix, option, mktree_usage, 0);
#  171|   	getline_fn = nul_term_line ? strbuf_getline_nul : strbuf_getline_lf;
#  172|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
git-2.45.2-build/git-2.45.2/builtin/name-rev.c: scope_hint: In function ‘name_rev’
git-2.45.2-build/git-2.45.2/builtin/name-rev.c:224:50: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.45.2-build/git-2.45.2/commit-slab-impl.h:88:16: note: in definition of macro ‘implement_commit_slab’
git-2.45.2-build/git-2.45.2/commit-slab.h:64:9: note: in expansion of macro ‘implement_static_commit_slab’
git-2.45.2-build/git-2.45.2/builtin/name-rev.c:34:1: note: in expansion of macro ‘define_commit_slab’
git-2.45.2-build/git-2.45.2/builtin/name-rev.c: scope_hint: In function ‘name_rev’
git-2.45.2-build/git-2.45.2/commit-slab-impl.h:52:17: note: in definition of macro ‘implement_commit_slab’
git-2.45.2-build/git-2.45.2/commit-slab.h:64:9: note: in expansion of macro ‘implement_static_commit_slab’
git-2.45.2-build/git-2.45.2/builtin/name-rev.c:34:1: note: in expansion of macro ‘define_commit_slab’
git-2.45.2-build/git-2.45.2/commit-slab-impl.h:5:9: note: in expansion of macro ‘implement_commit_slab’
git-2.45.2-build/git-2.45.2/commit-slab.h:64:9: note: in expansion of macro ‘implement_static_commit_slab’
git-2.45.2-build/git-2.45.2/builtin/name-rev.c:34:1: note: in expansion of macro ‘define_commit_slab’
git-2.45.2-build/git-2.45.2/commit-slab-impl.h:88:16: note: in definition of macro ‘implement_commit_slab’
git-2.45.2-build/git-2.45.2/commit-slab.h:64:9: note: in expansion of macro ‘implement_static_commit_slab’
git-2.45.2-build/git-2.45.2/builtin/name-rev.c:34:1: note: in expansion of macro ‘define_commit_slab’
git-2.45.2-build/git-2.45.2/builtin/name-rev.c: scope_hint: In function ‘name_rev’
#  222|   				distance = name->distance + MERGE_TRAVERSAL_WEIGHT;
#  223|   			} else {
#  224|-> 				generation = name->generation + 1;
#  225|   				distance = name->distance + 1;
#  226|   			}

Error: CLANG_WARNING: [#def46]
git-2.45.2-build/git-2.45.2/builtin/pack-redundant.c:479:7: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'pl')
#  477|   
#  478|   	/* only one packfile */
#  479|-> 	if (!pl->next) {
#  480|   		llist_init(&pl->unique_objects);
#  481|   		return;

Error: CLANG_WARNING: [#def47]
git-2.45.2-build/git-2.45.2/builtin/patch-id.c:237:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  235|   		config.stable = 1;
#  236|   
#  237|-> 	argc = parse_options(argc, argv, prefix, builtin_patch_id_options,
#  238|   			     patch_id_usage, 0);
#  239|   

Error: CLANG_WARNING: [#def48]
git-2.45.2-build/git-2.45.2/builtin/pull.c:753:8: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  751|   
#  752|   	if (*spec_src) {
#  753|-> 		if (!strcmp(remote, "."))
#  754|   			merge_branch = mkpath("refs/heads/%s", spec_src);
#  755|   		else

Error: GCC_ANALYZER_WARNING (CWE-688): [#def49]
git-2.45.2-build/git-2.45.2/builtin/pull.c: scope_hint: In function ‘get_tracking_branch’
git-2.45.2-build/git-2.45.2/builtin/pull.c:753:22: warning[-Wanalyzer-null-argument]: use of NULL ‘remote’ where non-null expected
git-2.45.2-build/git-2.45.2/builtin/pull.c: scope_hint: In function ‘get_tracking_branch’
git-2.45.2-build/git-2.45.2/git-compat-util.h:241: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/pull.c:9: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
#  751|   
#  752|   	if (*spec_src) {
#  753|-> 		if (!strcmp(remote, "."))
#  754|   			merge_branch = mkpath("refs/heads/%s", spec_src);
#  755|   		else

Error: CLANG_WARNING: [#def50]
git-2.45.2-build/git-2.45.2/builtin/rebase.c:1671:6: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1669|   	} else if (!options.onto_name)
# 1670|   		options.onto_name = options.upstream_name;
# 1671|-> 	if (strstr(options.onto_name, "...")) {
# 1672|   		if (repo_get_oid_mb(the_repository, options.onto_name, &branch_base) < 0) {
# 1673|   			if (keep_base)

Error: CLANG_WARNING: [#def51]
git-2.45.2-build/git-2.45.2/builtin/rebase.c:1737:14: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1735|   			if (!(options.flags & REBASE_NO_QUIET))
# 1736|   				; /* be quiet */
# 1737|-> 			else if (!strcmp(branch_name, "HEAD") &&
# 1738|   				 resolve_ref_unsafe("HEAD", 0, NULL, &flag))
# 1739|   				puts(_("HEAD is up to date."));

Error: CLANG_WARNING: [#def52]
git-2.45.2-build/git-2.45.2/builtin/receive-pack.c:617:14: warning[deadcode.DeadStores]: Value stored to 'retval' during its initialization is never read
#  615|   	timestamp_t stamp, ostamp;
#  616|   	char *bohmac, *expect = NULL;
#  617|-> 	const char *retval = NONCE_BAD;
#  618|   
#  619|   	if (!nonce) {

Error: CLANG_WARNING: [#def53]
git-2.45.2-build/git-2.45.2/builtin/remote.c:1051:15: warning[deadcode.DeadStores]: Value stored to 'arg' during its initialization is never read
# 1049|   	if (states->queried) {
# 1050|   		const char *fmt = "%s";
# 1051|-> 		const char *arg = "";
# 1052|   		if (string_list_has_string(&states->new_refs, name)) {
# 1053|   			fmt = _(" new (next fetch will store in remotes/%s)");

Error: CLANG_WARNING: [#def54]
git-2.45.2-build/git-2.45.2/builtin/repack.c:1200:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 1198|   	git_config(repack_config, &cruft_po_args);
# 1199|   
# 1200|-> 	argc = parse_options(argc, argv, prefix, builtin_repack_options,
# 1201|   				git_repack_usage, 0);
# 1202|   

Error: CLANG_WARNING: [#def55]
git-2.45.2-build/git-2.45.2/builtin/reset.c:373:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  371|   	git_config(git_reset_config, NULL);
#  372|   
#  373|-> 	argc = parse_options(argc, argv, prefix, options, git_reset_usage,
#  374|   						PARSE_OPT_KEEP_DASHDASH);
#  375|   	parse_args(&pathspec, argv, prefix, patch_mode, &rev);

Error: CLANG_WARNING: [#def56]
git-2.45.2-build/git-2.45.2/builtin/rev-parse.c:541:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  539|   	ALLOC_GROW(opts, onb + 1, osz);
#  540|   	memset(opts + onb, 0, sizeof(opts[onb]));
#  541|-> 	argc = parse_options(argc, argv, prefix, opts, usage,
#  542|   			(keep_dashdash ? PARSE_OPT_KEEP_DASHDASH : 0) |
#  543|   			(stop_at_non_option ? PARSE_OPT_STOP_AT_NON_OPTION : 0) |

Error: CLANG_WARNING: [#def57]
git-2.45.2-build/git-2.45.2/builtin/revert.c:247:2: warning[unix.Malloc]: Argument to free() is the address of the local variable 'base_options', which is not memory allocated by malloc()
#  245|   	if (!opts->strategy && getenv("GIT_TEST_MERGE_ALGORITHM"))
#  246|   		opts->strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
#  247|-> 	free(options);
#  248|   
#  249|   	if (cmd == 'q') {

Error: CLANG_WARNING: [#def58]
git-2.45.2-build/git-2.45.2/builtin/rm.c:273:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  271|   	git_config(git_default_config, NULL);
#  272|   
#  273|-> 	argc = parse_options(argc, argv, prefix, builtin_rm_options,
#  274|   			     builtin_rm_usage, 0);
#  275|   

Error: CLANG_WARNING: [#def59]
git-2.45.2-build/git-2.45.2/builtin/show-branch.c:905:5: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  903|   			}
#  904|   			else
#  905|-> 				puts(reflog_msg[i]);
#  906|   
#  907|   			if (is_head)

Error: CLANG_WARNING: [#def60]
git-2.45.2-build/git-2.45.2/builtin/show-index.c:29:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#   27|   	};
#   28|   
#   29|-> 	argc = parse_options(argc, argv, prefix, show_index_options, show_index_usage, 0);
#   30|   
#   31|   	if (hash_name) {

Error: CLANG_WARNING: [#def61]
git-2.45.2-build/git-2.45.2/builtin/show-ref.c:314:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  312|   	git_config(git_default_config, NULL);
#  313|   
#  314|-> 	argc = parse_options(argc, argv, prefix, show_ref_options,
#  315|   			     show_ref_usage, 0);
#  316|   

Error: CLANG_WARNING: [#def62]
git-2.45.2-build/git-2.45.2/builtin/sparse-checkout.c:64:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#   62|   		die(_("this worktree is not sparse"));
#   63|   
#   64|-> 	argc = parse_options(argc, argv, prefix,
#   65|   			     builtin_sparse_checkout_list_options,
#   66|   			     builtin_sparse_checkout_list_usage, 0);

Error: CLANG_WARNING: [#def63]
git-2.45.2-build/git-2.45.2/builtin/sparse-checkout.c:459:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  457|   	init_opts.sparse_index = -1;
#  458|   
#  459|-> 	argc = parse_options(argc, argv, prefix,
#  460|   			     builtin_sparse_checkout_init_options,
#  461|   			     builtin_sparse_checkout_init_usage, 0);

Error: CLANG_WARNING: [#def64]
git-2.45.2-build/git-2.45.2/builtin/sparse-checkout.c:870:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  868|   	reapply_opts.sparse_index = -1;
#  869|   
#  870|-> 	argc = parse_options(argc, argv, prefix,
#  871|   			     builtin_sparse_checkout_reapply_options,
#  872|   			     builtin_sparse_checkout_reapply_usage, 0);

Error: CLANG_WARNING: [#def65]
git-2.45.2-build/git-2.45.2/builtin/sparse-checkout.c:908:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  906|   
#  907|   	setup_work_tree();
#  908|-> 	argc = parse_options(argc, argv, prefix,
#  909|   			     builtin_sparse_checkout_disable_options,
#  910|   			     builtin_sparse_checkout_disable_usage, 0);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def66]
git-2.45.2-build/git-2.45.2/builtin/sparse-checkout.c: scope_hint: In function ‘sparse_checkout_check_rules’
git-2.45.2-build/git-2.45.2/builtin/sparse-checkout.c:1003:17: warning[-Wanalyzer-null-argument]: use of NULL ‘xfopen(check_rules_opts.rules_file, "r")’ where non-null expected
git-2.45.2-build/git-2.45.2/dir.h:8: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/sparse-checkout.c:3: included_from: Included from here.
git-2.45.2-build/git-2.45.2/git-compat-util.h:256: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/sparse-checkout.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/sparse-checkout.c: scope_hint: In function ‘sparse_checkout_check_rules’
git-2.45.2-build/git-2.45.2/git-compat-util.h:234: included_from: Included from here.
/usr/include/stdio.h:184:12: note: argument 1 of ‘fclose’ must be non-null
# 1001|   		fp = xfopen(check_rules_opts.rules_file, "r");
# 1002|   		add_patterns_from_input(&pl, argc, argv, fp);
# 1003|-> 		fclose(fp);
# 1004|   	} else {
# 1005|   		sparse_filename = get_sparse_checkout_filename();

Error: CLANG_WARNING: [#def67]
git-2.45.2-build/git-2.45.2/builtin/stash.c:823:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  821|   	};
#  822|   
#  823|-> 	argc = parse_options(argc, argv, prefix, options,
#  824|   			     git_stash_list_usage,
#  825|   			     PARSE_OPT_KEEP_UNKNOWN_OPT);

Error: CLANG_WARNING: [#def68]
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:97:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller
#   95|   		exit(code);
#   96|   
#   97|-> 	return default_remote;
#   98|   }
#   99|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def69]
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c: scope_hint: In function ‘get_default_remote’
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:97:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘default_remote’
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c: scope_hint: In function ‘get_default_remote’
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:5: included_from: Included from here.
#   95|   		exit(code);
#   96|   
#   97|-> 	return default_remote;
#   98|   }
#   99|   

Error: CLANG_WARNING: [#def70]
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:754:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  752|   	int ret = 1;
#  753|   
#  754|-> 	argc = parse_options(argc, argv, prefix, module_status_options,
#  755|   			     git_submodule_helper_usage, 0);
#  756|   

Error: CLANG_WARNING: [#def71]
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:1276:39: warning[core.NullDereference]: Access to field 'name' results in a dereference of a null pointer (loaded from variable 'sub')
# 1274|   
# 1275|   	strbuf_reset(&sb);
# 1276|-> 	strbuf_addf(&sb, "submodule.%s.url", sub->name);
# 1277|   	if (git_config_set_gently(sb.buf, super_config_url))
# 1278|   		die(_("failed to register url for submodule path '%s'"),

Error: CLANG_WARNING: [#def72]
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:1289:15: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
# 1287|   		exit(code);
# 1288|   
# 1289|-> 	remote_key = xstrfmt("remote.%s.url", default_remote);
# 1290|   	free(default_remote);
# 1291|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def73]
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c: scope_hint: In function ‘sync_submodule’
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:1289:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘default_remote’
git-2.45.2-build/git-2.45.2/dir.h:8: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:14: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:1275:9: note: in expansion of macro ‘strbuf_reset’
git-2.45.2-build/git-2.45.2/git-compat-util.h:256: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:2: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:1275:9: note: in expansion of macro ‘strbuf_reset’
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:1284:9: note: in expansion of macro ‘strbuf_reset’
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:1284:9: note: in expansion of macro ‘strbuf_reset’
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:1284:9: note: in expansion of macro ‘strbuf_reset’
# 1287|   		exit(code);
# 1288|   
# 1289|-> 	remote_key = xstrfmt("remote.%s.url", default_remote);
# 1290|   	free(default_remote);
# 1291|   

Error: CLANG_WARNING: [#def74]
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:1357:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 1355|   	int ret = 1;
# 1356|   
# 1357|-> 	argc = parse_options(argc, argv, prefix, module_sync_options,
# 1358|   			     git_submodule_helper_usage, 0);
# 1359|   

Error: CLANG_WARNING: [#def75]
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:2616:16: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
# 2614|   		if (code)
# 2615|   			return code;
# 2616|-> 		remote_ref = xstrfmt("refs/remotes/%s/%s", remote_name, branch);
# 2617|   
# 2618|   		free(remote_name);

Error: CLANG_WARNING: [#def76]
git-2.45.2-build/git-2.45.2/builtin/submodule--helper.c:2951:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 2949|   	int ret = 1;
# 2950|   
# 2951|-> 	argc = parse_options(argc, argv, prefix, embed_gitdir_options,
# 2952|   			     git_submodule_helper_usage, 0);
# 2953|   

Error: CLANG_WARNING: [#def77]
git-2.45.2-build/git-2.45.2/builtin/update-index.c:1109:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 1107|   		}
# 1108|   	}
# 1109|-> 	argc = parse_options_end(&ctx);
# 1110|   
# 1111|   	getline_fn = nul_term_line ? strbuf_getline_nul : strbuf_getline_lf;

Error: CLANG_WARNING: [#def78]
git-2.45.2-build/git-2.45.2/builtin/write-tree.c:41:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#   39|   
#   40|   	git_config(git_default_config, NULL);
#   41|-> 	argc = parse_options(argc, argv, cmd_prefix, write_tree_options,
#   42|   			     write_tree_usage, 0);
#   43|   

Error: CLANG_WARNING: [#def79]
git-2.45.2-build/git-2.45.2/color.c:64:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller
#   62|   static int match_word(const char *word, int len, const char *match)
#   63|   {
#   64|-> 	return !strncasecmp(word, match, len) && !match[len];
#   65|   }
#   66|   

Error: GCC_ANALYZER_WARNING: [#def80]
git-2.45.2-build/git-2.45.2/column.c: scope_hint: In function ‘run_column_filter’
git-2.45.2-build/git-2.45.2/column.c:393:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
#  391|   	fd_out = dup(1);
#  392|   	close(1);
#  393|-> 	dup2(column_process.in, 1);
#  394|   	close(column_process.in);
#  395|   	return 0;

Error: GCC_ANALYZER_WARNING: [#def81]
git-2.45.2-build/git-2.45.2/column.c: scope_hint: In function ‘stop_column_filter’
git-2.45.2-build/git-2.45.2/column.c:406:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
#  404|   	close(1);
#  405|   	finish_command(&column_process);
#  406|-> 	dup2(fd_out, 1);
#  407|   	close(fd_out);
#  408|   	fd_out = -1;

Error: CLANG_WARNING: [#def82]
git-2.45.2-build/git-2.45.2/combine-diff.c:262:13: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer (loaded from variable 'newend')
#  260|   			baseend->parent_map |= 1<<parent;
#  261|   			baseend = baseend->prev;
#  262|-> 			newend = newend->prev;
#  263|   			i--;
#  264|   			j--;

Error: CLANG_WARNING: [#def83]
git-2.45.2-build/git-2.45.2/combine-diff.c:270:8: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer (loaded from variable 'lline')
#  268|   			lline = newend;
#  269|   			/* Remove lline from new list and update newend */
#  270|-> 			if (lline->prev)
#  271|   				lline->prev->next = lline->next;
#  272|   			else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def84]
git-2.45.2-build/git-2.45.2/combine-diff.c: scope_hint: In function ‘show_patch_diff’
git-2.45.2-build/git-2.45.2/combine-diff.c:1082:38: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*elem.path, 0)’
git-2.45.2-build/git-2.45.2/git-compat-util.h:235: included_from: Included from here.
git-2.45.2-build/git-2.45.2/combine-diff.c:1: included_from: Included from here.
# 1080|   			free_filespec(df);
# 1081|   		} else if (0 <= (fd = open(elem->path, O_RDONLY))) {
# 1082|-> 			size_t len = xsize_t(st.st_size);
# 1083|   			ssize_t done;
# 1084|   			int is_file, i;

Error: CLANG_WARNING: [#def85]
git-2.45.2-build/git-2.45.2/commit-graph.c:944:3: warning[deadcode.DeadStores]: Value stored to 'pptr' is never read
#  942|   		return 1;
#  943|   	if (!(edge_value & GRAPH_EXTRA_EDGES_NEEDED)) {
#  944|-> 		pptr = insert_parent_or_die(r, g, edge_value, pptr);
#  945|   		return 1;
#  946|   	}

Error: CLANG_WARNING: [#def86]
git-2.45.2-build/git-2.45.2/commit-graph.c:2239:52: warning[core.NullDereference]: Access to field 'odb' results in a dereference of a null pointer (loaded from variable 'g')
# 2237|   
# 2238|   	if (ctx->num_commit_graphs_after == 2) {
# 2239|-> 		char *old_graph_name = get_commit_graph_filename(g->odb);
# 2240|   
# 2241|   		if (!strcmp(g->filename, old_graph_name) &&

Error: CLANG_WARNING: [#def87]
git-2.45.2-build/git-2.45.2/commit-reach.c:571:2: warning[deadcode.DeadStores]: Value stored to 'next' is never read
#  569|   	struct commit_list **next = &list;
#  570|   
#  571|-> 	next = commit_list_append(commit, next);
#  572|   	res = repo_is_descendant_of(r, reference, list);
#  573|   	free_commit_list(list);

Error: CLANG_WARNING: [#def88]
git-2.45.2-build/git-2.45.2/compat/terminal.c:508:8: warning[deadcode.DeadStores]: Value stored to 'eol' is never read
#  506|   			strbuf_setlen(&buf, 0);
#  507|   
#  508|-> 		for (eol = p = buf.buf; *p; p = eol + 1) {
#  509|   			p = strchr(p, '=');
#  510|   			if (!p)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def89]
git-2.45.2-build/git-2.45.2/config.c: scope_hint: In function ‘matches’
git-2.45.2-build/git-2.45.2/config.c:2884:25: warning[-Wanalyzer-null-argument]: use of NULL ‘value’ where non-null expected
git-2.45.2-build/git-2.45.2/config.c:20: included_from: Included from here.
git-2.45.2-build/git-2.45.2/config.c: scope_hint: In function ‘matches’
git-2.45.2-build/git-2.45.2/config.c:8: included_from: Included from here.
git-2.45.2-build/git-2.45.2/config.c:3353:17: note: in expansion of macro ‘ALLOC_GROW’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1258: included_from: Included from here.
git-2.45.2-build/git-2.45.2/sane-ctype.h:31:20: note: in expansion of macro ‘sane_istest’
git-2.45.2-build/git-2.45.2/config.c:1082:21: note: in expansion of macro ‘isspace’
git-2.45.2-build/git-2.45.2/tempfile.h:5: included_from: Included from here.
git-2.45.2-build/git-2.45.2/lockfile.h:118: included_from: Included from here.
git-2.45.2-build/git-2.45.2/git-compat-util.h:241: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 2 of ‘strcmp’ must be non-null
# 2882|   		return 0; /* not ours */
# 2883|   	if (store->fixed_value)
# 2884|-> 		return !strcmp(store->fixed_value, value);
# 2885|   	if (!store->value_pattern)
# 2886|   		return 1; /* always matches */

Error: CPPCHECK_WARNING: [#def90]
git-2.45.2-build/git-2.45.2/contrib/credential/libsecret/git-credential-libsecret.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def91]
git-2.45.2-build/git-2.45.2/convert.c:49:21: warning[core.NullDereference]: Array access (from variable 'buf') results in a null pointer dereference
#   47|   
#   48|   	for (i = 0; i < size; i++) {
#   49|-> 		unsigned char c = buf[i];
#   50|   		if (c == '\r') {
#   51|   			if (i+1 < size && buf[i+1] == '\n') {

Error: CLANG_WARNING: [#def92]
git-2.45.2-build/git-2.45.2/convert.c:569:22: warning[core.NullDereference]: Dereference of null pointer
#  567|   		 */
#  568|   		do {
#  569|-> 			unsigned char c = *src++;
#  570|   			if (c != '\r')
#  571|   				*dst++ = c;

Error: CLANG_WARNING: [#def93]
git-2.45.2-build/git-2.45.2/daemon.c:885:22: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  883|   	}
#  884|   
#  885|-> 	if (addr->sa_family == AF_INET) {
#  886|   		char buf[128] = "";
#  887|   		struct sockaddr_in *sin_addr = (void *) addr;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def94]
git-2.45.2-build/git-2.45.2/diagnose.c: scope_hint: In function ‘create_diagnostics_archive’
git-2.45.2-build/git-2.45.2/diagnose.c:208:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(xopen(*zip_path.buf, 577, 438), 1)’
#  206|   
#  207|   	archiver_fd = xopen(zip_path->buf, O_CREAT | O_WRONLY | O_TRUNC, 0666);
#  208|-> 	if (dup2(archiver_fd, STDOUT_FILENO) < 0) {
#  209|   		res = error_errno(_("could not redirect output"));
#  210|   		goto diagnose_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
git-2.45.2-build/git-2.45.2/diagnose.c:279:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_fd’
git-2.45.2-build/git-2.45.2/diagnose.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/diagnose.c:209:23: note: in expansion of macro ‘error_errno’
git-2.45.2-build/git-2.45.2/diagnose.c:209:23: note: in expansion of macro ‘error_errno’
git-2.45.2-build/git-2.45.2/compat/disk.h:5: included_from: Included from here.
git-2.45.2-build/git-2.45.2/diagnose.c:3: included_from: Included from here.
git-2.45.2-build/git-2.45.2/diagnose.c:209:23: note: in expansion of macro ‘error_errno’
#  277|   	strbuf_release(&buf);
#  278|   
#  279|-> 	return res;
#  280|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def96]
git-2.45.2-build/git-2.45.2/diff-lib.c: scope_hint: In function ‘get_stat_data’
git-2.45.2-build/git-2.45.2/diff-lib.c:315:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ce’
#  313|   {
#  314|   	const struct object_id *oid = &ce->oid;
#  315|-> 	unsigned int mode = ce->ce_mode;
#  316|   
#  317|   	if (!cached && !ce_uptodate(ce)) {

Error: CLANG_WARNING: [#def97]
git-2.45.2-build/git-2.45.2/diff-no-index.c:63:12: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'special')
#   61|   	} else if (path == file_from_standard_input) {
#   62|   		*mode = create_ce_mode(0666);
#   63|-> 		*special = SPECIAL_STDIN;
#   64|   	} else if (lstat(path, &st)) {
#   65|   		return error("Could not access '%s'", path);

Error: CLANG_WARNING: [#def98]
git-2.45.2-build/git-2.45.2/diffcore-break.c:292:9: warning[core.NullDereference]: Access to field 'broken_pair' results in a dereference of a null pointer (loaded from variable 'pp')
#  290|   			for (j = i + 1; j < q->nr; j++) {
#  291|   				struct diff_filepair *pp = q->queue[j];
#  292|-> 				if (pp->broken_pair &&
#  293|   				    !strcmp(pp->one->path, pp->two->path) &&
#  294|   				    !strcmp(p->one->path, pp->two->path)) {

Error: CLANG_WARNING: [#def99]
git-2.45.2-build/git-2.45.2/diffcore-pickaxe.c:169:8: warning[core.CallAndMessage]: Called function pointer is null (null dereference)
#  167|   	mf2.size = fill_textconv(o->repo, textconv_two, p->two, &mf2.ptr);
#  168|   
#  169|-> 	ret = fn(&mf1, &mf2, o, regexp, kws);
#  170|   
#  171|   	if (textconv_one)

Error: CLANG_WARNING: [#def100]
git-2.45.2-build/git-2.45.2/diffcore-rename.c:1481:2: warning[deadcode.DeadStores]: Value stored to 'num_sources' is never read
# 1479|   		goto cleanup;
# 1480|   
# 1481|-> 	num_sources = rename_src_nr;
# 1482|   
# 1483|   	if (want_copies || break_idx) {

Error: CLANG_WARNING: [#def101]
git-2.45.2-build/git-2.45.2/diffcore-rename.c:1628:3: warning[deadcode.DeadStores]: Value stored to 'rename_count' is never read
# 1626|   				     &info, dirs_removed);
# 1627|   	if (want_copies)
# 1628|-> 		rename_count += find_renames(mx, dst_cnt, minimum_score, 1,
# 1629|   					     &info, dirs_removed);
# 1630|   	free(mx);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def102]
git-2.45.2-build/git-2.45.2/dir.c:3872:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dir’
git-2.45.2-build/git-2.45.2/dir.c: scope_hint: In function ‘invalidate_one_component’
# 3870|   {
# 3871|   	uc->dir_invalidated++;
# 3872|-> 	ucd->valid = 0;
# 3873|   	ucd->untracked_nr = 0;
# 3874|   }

Error: CLANG_WARNING: [#def103]
git-2.45.2-build/git-2.45.2/ewah/ewah_io.c:131:2: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  129|   	self->rlw = self->buffer + get_be32(ptr);
#  130|   	ptr += sizeof(uint32_t);
#  131|-> 	len -= sizeof(uint32_t);
#  132|   
#  133|   	return ptr - (const uint8_t *)map;

Error: CLANG_WARNING: [#def104]
git-2.45.2-build/git-2.45.2/fsck.c:882:2: warning[deadcode.DeadStores]: Value stored to 'p' is never read
#  880|   	    (p[5] != '\n'))
#  881|   		return report(options, oid, type, FSCK_MSG_BAD_TIMEZONE, "invalid author/committer line - bad time zone");
#  882|-> 	p += 6;
#  883|   	return 0;
#  884|   }

Error: CLANG_WARNING: [#def105]
git-2.45.2-build/git-2.45.2/pretty.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/git-compat-util.h:1094:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1092|   {
# 1093|   	if (n)
# 1094|-> 		memcpy(dst, src, st_mult(size, n));
# 1095|   }
# 1096|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def106]
git-2.45.2-build/git-2.45.2/line-log.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/git-compat-util.h: scope_hint: In function ‘copy_array’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1094:17: warning[-Wanalyzer-null-argument]: use of NULL ‘dst’ where non-null expected
git-2.45.2-build/git-2.45.2/git-compat-util.h:256: included_from: Included from here.
git-2.45.2-build/git-2.45.2/line-log.c: scope_hint: In function ‘copy_array’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1089:45: note: in definition of macro ‘COPY_ARRAY’
git-2.45.2-build/git-2.45.2/line-log.c:47:9: note: in expansion of macro ‘COPY_ARRAY’
git-2.45.2-build/git-2.45.2/line-log.c:47:9: note: in expansion of macro ‘COPY_ARRAY’
git-2.45.2-build/git-2.45.2/line-log.c: scope_hint: In function ‘copy_array’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1089:45: note: in definition of macro ‘COPY_ARRAY’
git-2.45.2-build/git-2.45.2/line-log.c:47:9: note: in expansion of macro ‘COPY_ARRAY’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1000:13: note: in expansion of macro ‘unsigned_mult_overflows’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1000:13: note: in expansion of macro ‘unsigned_mult_overflows’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 1092|   {
# 1093|   	if (n)
# 1094|-> 		memcpy(dst, src, st_mult(size, n));
# 1095|   }
# 1096|   

Error: CLANG_WARNING: [#def107]
git-2.45.2-build/git-2.45.2/builtin/update-index.c:7: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/git-compat-util.h:1303:6: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1301|   	errno = 0;
# 1302|   	/* negative values would be accepted by strtoul */
# 1303|-> 	if (strchr(s, '-'))
# 1304|   		return -1;
# 1305|   	ul = strtoul(s, &p, base);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def108]
git-2.45.2-build/git-2.45.2/gpg-interface.c: scope_hint: In function ‘parse_gpg_output’
git-2.45.2-build/git-2.45.2/gpg-interface.c:264:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next’
git-2.45.2-build/git-2.45.2/gpg-interface.c: scope_hint: In function ‘parse_gpg_output’
#  262|   					replace_cstring(&sigc->key, line, next);
#  263|   					/* Do we have signer information? */
#  264|-> 					if (*next && (sigcheck_gpg_status[i].flags & GPG_STATUS_UID)) {
#  265|   						line = next + 1;
#  266|   						next = strchrnul(line, '\n');

Error: GCC_ANALYZER_WARNING (CWE-476): [#def109]
git-2.45.2-build/git-2.45.2/gpg-interface.c:305:54: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next’
git-2.45.2-build/git-2.45.2/gpg-interface.c: scope_hint: In function ‘parse_gpg_output’
#  303|   					limit = strchrnul(line, '\n');
#  304|   					for (j = 9; j > 0; j--) {
#  305|-> 						if (!*next || limit <= next)
#  306|   							break;
#  307|   						line = next + 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def110]
git-2.45.2-build/git-2.45.2/graph.c: scope_hint: In function ‘graph_output_post_merge_line’
git-2.45.2-build/git-2.45.2/graph.c:1108:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parents’
# 1106|   
# 1107|   			for (j = 0; j < graph->num_parents; j++) {
# 1108|-> 				par_column = graph_find_new_column_by_commit(graph, parents->item);
# 1109|   				assert(par_column >= 0);
# 1110|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def111]
git-2.45.2-build/git-2.45.2/graph.c:1141:47: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1139|   		}
# 1140|   
# 1141|-> 		if (col_commit == first_parent->item)
# 1142|   			parent_col = col;
# 1143|   	}

Error: CLANG_WARNING: [#def112]
git-2.45.2-build/git-2.45.2/grep.c:787:3: warning[deadcode.DeadStores]: Value stored to 'extended' is never read
#  785|   
#  786|   	if (opt->all_match || opt->no_body_match || header_expr)
#  787|-> 		extended = 1;
#  788|   	else if (!extended)
#  789|   		return;

Error: CLANG_WARNING: [#def113]
git-2.45.2-build/git-2.45.2/grep.c:1464:23: warning[core.UndefinedBinaryOperatorResult]: The left operand of '<' is a garbage value
# 1462|   
# 1463|   		hit = patmatch(p, bol, bol + *left_p, &m, 0);
# 1464|-> 		if (!hit || m.rm_so < 0 || m.rm_eo < 0)
# 1465|   			continue;
# 1466|   		if (earliest < 0 || m.rm_so < earliest)

Error: CLANG_WARNING: [#def114]
git-2.45.2-build/git-2.45.2/fmt-merge-msg.c:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/refs.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/commit.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/object.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/hash-ll.h:272:2: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#  270|   static inline void oidcpy(struct object_id *dst, const struct object_id *src)
#  271|   {
#  272|-> 	memcpy(dst->hash, src->hash, GIT_MAX_RAWSZ);
#  273|   	dst->algo = src->algo;
#  274|   }

Error: CLANG_WARNING: [#def115]
git-2.45.2-build/git-2.45.2/builtin/index-pack.c:6: included_from: Included from here.
git-2.45.2-build/git-2.45.2/hex.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/hash-ll.h:273:12: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  271|   {
#  272|   	memcpy(dst->hash, src->hash, GIT_MAX_RAWSZ);
#  273|-> 	dst->algo = src->algo;
#  274|   }
#  275|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def116]
git-2.45.2-build/git-2.45.2/hash-ll.h:273:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.45.2-build/git-2.45.2/commit.c: scope_hint: In function ‘commit_tree_extended’
#  271|   {
#  272|   	memcpy(dst->hash, src->hash, GIT_MAX_RAWSZ);
#  273|-> 	dst->algo = src->algo;
#  274|   }
#  275|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def117]
git-2.45.2-build/git-2.45.2/hash-ll.h:273:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘old_oid’
git-2.45.2-build/git-2.45.2/refs.c: scope_hint: In function ‘ref_transaction_add_update’
git-2.45.2-build/git-2.45.2/config.h:5: included_from: Included from here.
git-2.45.2-build/git-2.45.2/refs.c:7: included_from: Included from here.
git-2.45.2-build/git-2.45.2/refs.c:2725:9: note: in expansion of macro ‘for_each_string_list_item’
git-2.45.2-build/git-2.45.2/git-compat-util.h:256: included_from: Included from here.
git-2.45.2-build/git-2.45.2/refs.c:5: included_from: Included from here.
git-2.45.2-build/git-2.45.2/git-compat-util.h:1152:35: note: in definition of macro ‘FLEX_ALLOC_MEM’
git-2.45.2-build/git-2.45.2/refs.c:1238:9: note: in expansion of macro ‘FLEX_ALLOC_STR’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1163:9: note: in expansion of macro ‘FLEX_ALLOC_MEM’
git-2.45.2-build/git-2.45.2/refs.c:1238:9: note: in expansion of macro ‘FLEX_ALLOC_STR’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1163:9: note: in expansion of macro ‘FLEX_ALLOC_MEM’
git-2.45.2-build/git-2.45.2/refs.c:1238:9: note: in expansion of macro ‘FLEX_ALLOC_STR’
#  271|   {
#  272|   	memcpy(dst->hash, src->hash, GIT_MAX_RAWSZ);
#  273|-> 	dst->algo = src->algo;
#  274|   }
#  275|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def118]
git-2.45.2-build/git-2.45.2/builtin/patch-id.c:5: included_from: Included from here.
git-2.45.2-build/git-2.45.2/builtin/patch-id.c: scope_hint: In function ‘get_one_patchid’
git-2.45.2-build/git-2.45.2/hash.h:7:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pre_oid_str[0]’
git-2.45.2-build/git-2.45.2/builtin/patch-id.c:103:33: note: in expansion of macro ‘the_hash_algo’
git-2.45.2-build/git-2.45.2/builtin/patch-id.c: scope_hint: In function ‘get_one_patchid’
git-2.45.2-build/git-2.45.2/builtin/patch-id.c:103:33: note: in expansion of macro ‘the_hash_algo’
git-2.45.2-build/git-2.45.2/builtin/patch-id.c:103:33: note: in expansion of macro ‘the_hash_algo’
git-2.45.2-build/git-2.45.2/git-compat-util.h:241: 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
#    5|   #include "repository.h"
#    6|   
#    7|-> #define the_hash_algo the_repository->hash_algo
#    8|   
#    9|   static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)

Error: CLANG_WARNING: [#def119]
git-2.45.2-build/git-2.45.2/builtin/pull.c:18: included_from: Included from here.
git-2.45.2-build/git-2.45.2/oid-array.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/hash.h:32:6: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
#   30|   {
#   31|   	const struct git_hash_algo *algop;
#   32|-> 	if (!oid1->algo)
#   33|   		algop = the_hash_algo;
#   34|   	else

Error: CLANG_WARNING: [#def120]
git-2.45.2-build/git-2.45.2/help.c:777:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  775|   	};
#  776|   
#  777|-> 	argc = parse_options(argc, argv, prefix, options, usage, 0);
#  778|   
#  779|   	get_version_info(&buf, build_options);

Error: CLANG_WARNING: [#def121]
git-2.45.2-build/git-2.45.2/http-backend.c:424:4: warning[deadcode.DeadStores]: Value stored to 'n' is never read
#  422|   				die("zlib error inflating request, result %d", ret);
#  423|   
#  424|-> 			n = stream.total_out - cnt;
#  425|   			write_to_child(out, out_buf, stream.total_out - cnt, prog_name);
#  426|   			cnt = stream.total_out;

Error: CLANG_WARNING: [#def122]
git-2.45.2-build/git-2.45.2/http-walker.c:563:8: warning[core.NullDereference]: Access to field 'base' results in a dereference of a null pointer (loaded from field 'alt')
#  561|   	}
#  562|   	return error("Unable to find %s under %s", hash_to_hex(hash),
#  563|-> 		     data->alt->base);
#  564|   }
#  565|   

Error: CLANG_WARNING: [#def123]
git-2.45.2-build/git-2.45.2/imap-send.c:732:16: warning[deadcode.DeadStores]: Although the value stored to 'arg1' is used in the enclosing expression, the value is never actually read from 'arg1'
#  730|   			} else if (!strcmp("CAPABILITY", arg)) {
#  731|   				parse_capability(imap, cmd);
#  732|-> 			} else if ((arg1 = next_arg(&cmd))) {
#  733|   				; /*
#  734|   				   * Unhandled response-data with at least two words.

Error: CLANG_WARNING: [#def124]
git-2.45.2-build/git-2.45.2/kwset.c:502:19: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from field 'trie')
#  500|         /* Traverse the trie in level order again, fixing up all nodes whose
#  501|   	 shift exceeds their inherited maxshift. */
#  502|->       for (curr = kwset->trie->next; curr; curr = curr->next)
#  503|   	{
#  504|   	  if (curr->maxshift > curr->parent->maxshift)

Error: CLANG_WARNING: [#def125]
git-2.45.2-build/git-2.45.2/kwset.c:673:16: warning[core.NullDereference]: Array access results in a null pointer dereference
#  671|   	}
#  672|         else
#  673|-> 	d = delta[c = (end += d)[-1]];
#  674|         if (d)
#  675|   	continue;

Error: CLANG_WARNING: [#def126]
git-2.45.2-build/git-2.45.2/line-log.c:646:8: warning[deadcode.DeadStores]: Although the value stored to 'tmp' is used in the enclosing expression, the value is never actually read from 'tmp'
#  644|   
#  645|   	assert(r);
#  646|-> 	ret = tmp = prev = line_log_data_copy_one(r);
#  647|   	r = r->next;
#  648|   	while (r) {

Error: CLANG_WARNING: [#def127]
git-2.45.2-build/git-2.45.2/line-log.c:874:25: warning[core.NullDereference]: Array access (from variable 'ends') results in a null pointer dereference
#  872|   		return (char *)data;
#  873|   	else
#  874|-> 		return (char *)data + ends[line] + 1;
#  875|   }
#  876|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def128]
git-2.45.2-build/git-2.45.2/loose.c: scope_hint: In function ‘write_one_object’
git-2.45.2-build/git-2.45.2/loose.c:199:9: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘open(path.buf, 1089, 438)’
git-2.45.2-build/git-2.45.2/loose.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/loose.c:198:9: note: in expansion of macro ‘error_errno’
git-2.45.2-build/git-2.45.2/loose.c:7: included_from: Included from here.
git-2.45.2-build/git-2.45.2/loose.c:198:9: note: in expansion of macro ‘error_errno’
#  197|   errout:
#  198|   	error_errno(_("failed to write loose object index %s\n"), path.buf);
#  199|-> 	close(fd);
#  200|   	rollback_lock_file(&lock);
#  201|   	strbuf_release(&buf);

Error: CLANG_WARNING: [#def129]
git-2.45.2-build/git-2.45.2/notes.c:673:31: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'tws')
#  671|   {
#  672|   	int ret;
#  673|-> 	struct tree_write_stack *n = tws->next;
#  674|   	struct object_id s;
#  675|   	if (n) {

Error: CLANG_WARNING: [#def130]
git-2.45.2-build/git-2.45.2/object-name.c:2041:9: warning[unix.Malloc]: Use of memory after it is freed
# 2039|   			if (ce_stage(ce) == stage) {
# 2040|   				free(new_path);
# 2041|-> 				if (reject_tree_in_index(repo, only_to_die, ce,
# 2042|   							 stage, prefix, cp))
# 2043|   					return -1;

Error: CLANG_WARNING: [#def131]
git-2.45.2-build/git-2.45.2/pack-write.c:262:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  260|   	} else if (flags & WRITE_REV_VERIFY) {
#  261|   		struct stat statbuf;
#  262|-> 		if (stat(rev_name, &statbuf)) {
#  263|   			if (errno == ENOENT) {
#  264|   				/* .rev files are optional */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def132]
git-2.45.2-build/git-2.45.2/pack-write.c: scope_hint: In function ‘write_rev_file_order’
git-2.45.2-build/git-2.45.2/pack-write.c:262:21: warning[-Wanalyzer-null-argument]: use of NULL ‘rev_name’ where non-null expected
git-2.45.2-build/git-2.45.2/pack-write.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/pack-write.c:225:9: note: in expansion of macro ‘ALLOC_ARRAY’
git-2.45.2-build/git-2.45.2/pack-write.c:228:9: note: in expansion of macro ‘QSORT_S’
/usr/include/features.h:511: included_from: Included from here.
/usr/include/unistd.h:25: included_from: Included from here.
git-2.45.2-build/git-2.45.2/git-compat-util.h:233: included_from: Included from here.
/usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null
#  260|   	} else if (flags & WRITE_REV_VERIFY) {
#  261|   		struct stat statbuf;
#  262|-> 		if (stat(rev_name, &statbuf)) {
#  263|   			if (errno == ENOENT) {
#  264|   				/* .rev files are optional */

Error: CLANG_WARNING: [#def133]
git-2.45.2-build/git-2.45.2/parse-options.c:900:26: warning[core.NullDereference]: Dereference of null pointer (loaded from field 'opt')
#  898|   				if (ctx->opt)
#  899|   					check_typos(arg + 1, options);
#  900|-> 				if (internal_help && *ctx->opt == 'h')
#  901|   					goto show_usage;
#  902|   				goto unknown;

Error: CLANG_WARNING: [#def134]
git-2.45.2-build/git-2.45.2/parse-options.c:1046:14: warning[core.NullDereference]: Dereference of null pointer (loaded from field 'opt')
# 1044|   		if (ctx.argv[0][1] == '-') {
# 1045|   			error(_("unknown option `%s'"), ctx.argv[0] + 2);
# 1046|-> 		} else if (isascii(*ctx.opt)) {
# 1047|   			error(_("unknown switch `%c'"), *ctx.opt);
# 1048|   		} else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def135]
git-2.45.2-build/git-2.45.2/range-diff.c: scope_hint: In function ‘output’
git-2.45.2-build/git-2.45.2/range-diff.c:524:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘a_util’
#  522|   
#  523|   		/* Skip all the already-shown commits from the LHS. */
#  524|-> 		while (i < a->nr && a_util->shown)
#  525|   			a_util = ++i < a->nr ? a->items[i].util : NULL;
#  526|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def136]
git-2.45.2-build/git-2.45.2/range-diff.c:537:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b_util’
#  535|   
#  536|   		/* Show unmatched RHS commits. */
#  537|-> 		while (j < b->nr && b_util->matching < 0) {
#  538|   			if (!range_diff_opts->left_only)
#  539|   				output_pair_header(&opts, patch_no_width,

Error: CLANG_WARNING: [#def137]
git-2.45.2-build/git-2.45.2/range-diff.c:546:13: warning[core.NullDereference]: Dereference of null pointer
#  544|   		/* Show matching LHS/RHS pair. */
#  545|   		if (j < b->nr) {
#  546|-> 			a_util = a->items[b_util->matching].util;
#  547|   			output_pair_header(&opts, patch_no_width,
#  548|   					   &buf, &dashes, a_util, b_util);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def138]
git-2.45.2-build/git-2.45.2/range-diff.c:546:49: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b_util’
#  544|   		/* Show matching LHS/RHS pair. */
#  545|   		if (j < b->nr) {
#  546|-> 			a_util = a->items[b_util->matching].util;
#  547|   			output_pair_header(&opts, patch_no_width,
#  548|   					   &buf, &dashes, a_util, b_util);

Error: CLANG_WARNING: [#def139]
git-2.45.2-build/git-2.45.2/diff-lib.c:12: included_from: Included from here.
git-2.45.2-build/git-2.45.2/read-cache.h:41:52: warning[core.NullDereference]: Access to field 'ce_namelen' results in a dereference of a null pointer (loaded from variable 'ce')
#   39|   				char *seen)
#   40|   {
#   41|-> 	return match_pathspec(istate, pathspec, ce->name, ce_namelen(ce), 0, seen,
#   42|   			      S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode));
#   43|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def140]
git-2.45.2-build/git-2.45.2/git-compat-util.h:235: included_from: Included from here.
git-2.45.2-build/git-2.45.2/diff-lib.c:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/read-cache.h: scope_hint: In function ‘ce_path_match’
git-2.45.2-build/git-2.45.2/read-cache.h:42:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ce’
git-2.45.2-build/git-2.45.2/diff-lib.c:12: included_from: Included from here.
#   40|   {
#   41|   	return match_pathspec(istate, pathspec, ce->name, ce_namelen(ce), 0, seen,
#   42|-> 			      S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode));
#   43|   }
#   44|   

Error: CLANG_WARNING: [#def141]
git-2.45.2-build/git-2.45.2/ref-filter.c:1251:8: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1249|   	if (if_then_else->cmp_status == COMPARE_EQUAL) {
# 1250|   		if (str_len == cur->output.len &&
# 1251|-> 		    !memcmp(if_then_else->str, cur->output.buf, cur->output.len))
# 1252|   			if_then_else->condition_satisfied = 1;
# 1253|   	} else if (if_then_else->cmp_status == COMPARE_UNEQUAL) {

Error: CLANG_WARNING: [#def142]
git-2.45.2-build/git-2.45.2/ref-filter.c:1255:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1253|   	} else if (if_then_else->cmp_status == COMPARE_UNEQUAL) {
# 1254|   		if (str_len != cur->output.len ||
# 1255|-> 		    memcmp(if_then_else->str, cur->output.buf, cur->output.len))
# 1256|   			if_then_else->condition_satisfied = 1;
# 1257|   	} else if (cur->output.len && !is_empty(&cur->output))

Error: CLANG_WARNING: [#def143]
git-2.45.2-build/git-2.45.2/ref-filter.c:2075:15: warning[core.NullDereference]: Array access (from variable 'p') results in a null pointer dereference
# 2073|   
# 2074|   		/* Find total no of '/' separated path-components */
# 2075|-> 		for (i = 0; p[i]; p[i] == '/' ? i++ : *p++)
# 2076|   			;
# 2077|   		/*

Error: CLANG_WARNING: [#def144]
git-2.45.2-build/git-2.45.2/ref-filter.c:2113:15: warning[core.NullDereference]: Array access (from variable 'p') results in a null pointer dereference
# 2111|   
# 2112|   		/* Find total no of '/' separated path-components */
# 2113|-> 		for (i = 0; p[i]; p[i] == '/' ? i++ : *p++)
# 2114|   			;
# 2115|   		/*

Error: CLANG_WARNING: [#def145]
git-2.45.2-build/git-2.45.2/ref-filter.c:2510:23: warning[core.NullDereference]: Access to field 'type' results in a dereference of an undefined pointer value (loaded from variable 'obj')
# 2508|   	 * object, we are done.
# 2509|   	 */
# 2510|-> 	if (!need_tagged || (obj->type != OBJ_TAG))
# 2511|   		return 0;
# 2512|   

Error: GCC_ANALYZER_WARNING (CWE-835): [#def146]
git-2.45.2-build/git-2.45.2/refs.c: scope_hint: In function ‘check_refname_component’
git-2.45.2-build/git-2.45.2/refs.c:197:26: warning[-Wanalyzer-infinite-loop]: infinite loop
git-2.45.2-build/git-2.45.2/khash.h:29: included_from: Included from here.
git-2.45.2-build/git-2.45.2/oidset.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/object-store-ll.h:8: included_from: Included from here.
git-2.45.2-build/git-2.45.2/refs.c:19: included_from: Included from here.
#  195|   
#  196|   	for (cp = refname; ; cp++) {
#  197|-> 		int ch = *cp & 255;
#  198|   		unsigned char disp = refname_disposition[ch];
#  199|   

Error: CLANG_WARNING: [#def147]
git-2.45.2-build/git-2.45.2/refs/iterator.c:13:9: warning[core.NullDereference]: Access to field 'vtable' results in a dereference of a null pointer (loaded from variable 'ref_iterator')
#   11|   int ref_iterator_advance(struct ref_iterator *ref_iterator)
#   12|   {
#   13|-> 	return ref_iterator->vtable->advance(ref_iterator);
#   14|   }
#   15|   

Error: CLANG_WARNING: [#def148]
git-2.45.2-build/git-2.45.2/refs/iterator.c:202:25: warning[core.NullDereference]: Access to field 'refname' results in a dereference of a null pointer
#  200|   
#  201|   		if (selection & ITER_YIELD_CURRENT) {
#  202|-> 			iter->base.refname = (*iter->current)->refname;
#  203|   			iter->base.oid = (*iter->current)->oid;
#  204|   			iter->base.flags = (*iter->current)->flags;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
git-2.45.2-build/git-2.45.2/refs/packed-backend.c: scope_hint: In function ‘write_with_updates’
git-2.45.2-build/git-2.45.2/refs/packed-backend.c:1397:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘iter’
git-2.45.2-build/git-2.45.2/refs/packed-backend.c: scope_hint: In function ‘write_with_updates’
# 1395|   			int peel_error = ref_iterator_peel(iter, &peeled);
# 1396|   
# 1397|-> 			if (write_packed_entry(out, iter->refname,
# 1398|   					       iter->oid,
# 1399|   					       peel_error ? NULL : &peeled))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def150]
git-2.45.2-build/git-2.45.2/refs/reftable-backend.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/refs/reftable-backend.c: scope_hint: In function ‘queue_transaction_update’
git-2.45.2-build/git-2.45.2/refs/reftable-backend.c:704:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘arg’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1214:22: note: in definition of macro ‘ALLOC_GROW’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1214:22: note: in definition of macro ‘ALLOC_GROW’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1214:22: note: in definition of macro ‘ALLOC_GROW’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1214:22: note: in definition of macro ‘ALLOC_GROW’
#  702|   		return ret;
#  703|   
#  704|-> 	ALLOC_GROW(arg->updates, arg->updates_nr + 1,
#  705|   		   arg->updates_alloc);
#  706|   	arg->updates[arg->updates_nr].update = update;

Error: CLANG_WARNING: [#def151]
git-2.45.2-build/git-2.45.2/refs/reftable-backend.c:1469:4: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 1467|   			goto done;
# 1468|   		if (ret > 0 || strcmp(old_log.refname, arg->oldname)) {
# 1469|-> 			ret = 0;
# 1470|   			break;
# 1471|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def152]
git-2.45.2-build/git-2.45.2/reftable/publicbasics.c: scope_hint: In function ‘reftable_calloc’
git-2.45.2-build/git-2.45.2/reftable/publicbasics.c:44:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘reftable_malloc(st_mult(nelem,  elsize))’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
#   42|   	size_t sz = st_mult(nelem, elsize);
#   43|   	void *p = reftable_malloc(sz);
#   44|-> 	memset(p, 0, sz);
#   45|   	return p;
#   46|   }

Error: CLANG_WARNING: [#def153]
git-2.45.2-build/git-2.45.2/reftable/reader.c:145:2: warning[deadcode.DeadStores]: Value stored to 'f' is never read
#  143|   	computed_crc = crc32(0, footer, f - footer);
#  144|   	file_crc = get_be32(f);
#  145|-> 	f += 4;
#  146|   	if (computed_crc != file_crc) {
#  147|   		err = REFTABLE_FORMAT_ERROR;

Error: CLANG_WARNING: [#def154]
git-2.45.2-build/git-2.45.2/reftable/reader.c:267:29: warning[core.NullDereference]: Access to field 'block_size' results in a dereference of a null pointer (loaded from variable 'r')
#  265|   			     uint64_t next_off, uint8_t want_typ)
#  266|   {
#  267|-> 	int32_t guess_block_size = r->block_size ? r->block_size :
#  268|   							 DEFAULT_BLOCK_SIZE;
#  269|   	struct reftable_block block = { NULL };

Error: CLANG_WARNING: [#def155]
git-2.45.2-build/git-2.45.2/reftable/stack.c:926:4: warning[deadcode.DeadStores]: Value stored to 'err' is never read
#  924|   		err = reftable_iterator_next_ref(&it, &ref);
#  925|   		if (err > 0) {
#  926|-> 			err = 0;
#  927|   			break;
#  928|   		}

Error: CLANG_WARNING: [#def156]
git-2.45.2-build/git-2.45.2/reftable/stack_test.c:99:15: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#   97|   
#   98|   	for (i = 0; names[i]; i++) {
#   99|-> 		EXPECT(0 == strcmp(want[i], names[i]));
#  100|   	}
#  101|   	free_names(names);

Error: CLANG_WARNING: [#def157]
git-2.45.2-build/git-2.45.2/reftable/writer.c:65:2: warning[deadcode.DeadStores]: Value stored to 'n' is never read
#   63|   	if (n < 0)
#   64|   		return n;
#   65|-> 	n += padding;
#   66|   	return 0;
#   67|   }

Error: CLANG_WARNING: [#def158]
git-2.45.2-build/git-2.45.2/reftable/writer.c:612:2: warning[deadcode.DeadStores]: Value stored to 'p' is never read
#  610|   
#  611|   	put_be32(p, crc32(0, footer, p - footer));
#  612|-> 	p += 4;
#  613|   
#  614|   	err = w->flush(w->write_arg);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def159]
git-2.45.2-build/git-2.45.2/remote.c: scope_hint: In function ‘query_matches_negative_refspec’
git-2.45.2-build/git-2.45.2/remote.c:931:33: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘expn_name’
#  929|   
#  930|   			if (match_name_with_pattern(key, needle, value, &expn_name))
#  931|-> 				string_list_append_nodup(&reversed, expn_name);
#  932|   		} else if (refspec->matching) {
#  933|   			/* For the special matching refspec, any query should match */

Error: CLANG_WARNING: [#def160]
git-2.45.2-build/git-2.45.2/revision.c:1154:8: warning[core.NullDereference]: Access to field 'parents' results in a dereference of a null pointer (loaded from variable 'p')
# 1152|   			if (repo_parse_commit_gently(revs->repo, p, 1) < 0)
# 1153|   				continue;
# 1154|-> 			if (p->parents)
# 1155|   				mark_parents_uninteresting(revs, p);
# 1156|   			if (p->object.flags & SEEN)

Error: CLANG_WARNING: [#def161]
git-2.45.2-build/git-2.45.2/revision.c:1467:31: warning[core.NullDereference]: Access to field 'date' results in a dereference of a null pointer (loaded from variable 'commit')
# 1465|   			interesting_cache = NULL;
# 1466|   
# 1467|-> 		if (revs->max_age != -1 && (commit->date < revs->max_age))
# 1468|   			obj->flags |= UNINTERESTING;
# 1469|   		if (process_parents(revs, commit, &original_list, NULL) < 0)

Error: CLANG_WARNING: [#def162]
git-2.45.2-build/git-2.45.2/revision.c:1471:7: warning[core.NullDereference]: Access to field 'flags' results in a dereference of a null pointer (loaded from variable 'obj')
# 1469|   		if (process_parents(revs, commit, &original_list, NULL) < 0)
# 1470|   			return -1;
# 1471|-> 		if (obj->flags & UNINTERESTING) {
# 1472|   			mark_parents_uninteresting(revs, commit);
# 1473|   			slop = still_interesting(original_list, date, slop, &interesting_cache);

Error: CLANG_WARNING: [#def163]
git-2.45.2-build/git-2.45.2/revision.c:1907:7: warning[core.NullDereference]: Access to field 'type' results in a dereference of a null pointer (loaded from variable 'it')
# 1905|   		if (!it && revs->ignore_missing)
# 1906|   			return 0;
# 1907|-> 		if (it->type != OBJ_TAG)
# 1908|   			break;
# 1909|   		if (!((struct tag*)it)->tagged)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def164]
git-2.45.2-build/git-2.45.2/run-command.c: scope_hint: In function ‘child_dup2’
git-2.45.2-build/git-2.45.2/run-command.c:333:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd,  to)’
git-2.45.2-build/git-2.45.2/run-command.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/run-command.c:426:14: note: in expansion of macro ‘has_dir_sep’
git-2.45.2-build/git-2.45.2/run-command.c: scope_hint: In function ‘child_dup2’
git-2.45.2-build/git-2.45.2/run-command.c:480:9: note: in expansion of macro ‘ALLOC_ARRAY’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1000:13: note: in expansion of macro ‘unsigned_mult_overflows’
git-2.45.2-build/git-2.45.2/run-command.c: scope_hint: In function ‘child_dup2’
git-2.45.2-build/git-2.45.2/run-command.c:499:26: note: in definition of macro ‘CHECK_BUG’
git-2.45.2-build/git-2.45.2/run-command.c:514:9: note: in expansion of macro ‘CHECK_BUG’
git-2.45.2-build/git-2.45.2/run-command.c:499:26: note: in definition of macro ‘CHECK_BUG’
git-2.45.2-build/git-2.45.2/run-command.c:516:9: note: in expansion of macro ‘CHECK_BUG’
#  331|   static void child_dup2(int fd, int to)
#  332|   {
#  333|-> 	if (dup2(fd, to) < 0)
#  334|   		child_die(CHILD_ERR_DUP2);
#  335|   }

Error: CLANG_WARNING: [#def165]
git-2.45.2-build/git-2.45.2/scalar.c:513:7: warning[deadcode.DeadStores]: Although the value stored to 'res' is used in the enclosing expression, the value is never actually read from 'res'
#  511|   		return error(_("could not configure '%s'"), dir);
#  512|   
#  513|-> 	if ((res = run_git("fetch", "--quiet",
#  514|   				show_progress ? "--progress" : "--no-progress",
#  515|   				"origin", NULL))) {

Error: CLANG_WARNING: [#def166]
git-2.45.2-build/git-2.45.2/setup.c:375:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  373|   	/* Check non-worktree-related signatures */
#  374|   	if (getenv(DB_ENVIRONMENT)) {
#  375|-> 		if (access(getenv(DB_ENVIRONMENT), X_OK))
#  376|   			goto done;
#  377|   	}

Error: CLANG_WARNING: [#def167]
git-2.45.2-build/git-2.45.2/setup.c:1991:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1989|   static int needs_work_tree_config(const char *git_dir, const char *work_tree)
# 1990|   {
# 1991|-> 	if (!strcmp(work_tree, "/") && !strcmp(git_dir, "/.git"))
# 1992|   		return 0;
# 1993|   	if (skip_prefix(git_dir, work_tree, &git_dir) &&

Error: GCC_ANALYZER_WARNING (CWE-476): [#def168]
git-2.45.2-build/git-2.45.2/strbuf.c: scope_hint: In function ‘strbuf_grow’
git-2.45.2-build/git-2.45.2/strbuf.c:114:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.45.2-build/git-2.45.2/strbuf.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/git-compat-util.h:137:7: note: in definition of macro ‘unsigned_add_overflows’
git-2.45.2-build/git-2.45.2/strbuf.c:112:9: note: in expansion of macro ‘ALLOC_GROW’
#  112|   	ALLOC_GROW(sb->buf, sb->len + extra + 1, sb->alloc);
#  113|   	if (new_buf)
#  114|-> 		sb->buf[0] = '\0';
#  115|   }
#  116|   

Error: CLANG_WARNING: [#def169]
git-2.45.2-build/git-2.45.2/abspath.c:3: included_from: Included from here.
git-2.45.2-build/git-2.45.2/strbuf.h:170:16: warning[core.NullDereference]: Array access (via field 'buf') results in a null pointer dereference
#  168|   	sb->len = len;
#  169|   	if (sb->buf != strbuf_slopbuf)
#  170|-> 		sb->buf[len] = '\0';
#  171|   	else
#  172|   		assert(!strbuf_slopbuf[0]);

Error: CLANG_WARNING: [#def170]
git-2.45.2-build/git-2.45.2/pretty.c:9: included_from: Included from here.
git-2.45.2-build/git-2.45.2/diff.h:9: included_from: Included from here.
git-2.45.2-build/git-2.45.2/strbuf.h:310:20: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  308|   static inline void strbuf_addstr(struct strbuf *sb, const char *s)
#  309|   {
#  310|-> 	strbuf_add(sb, s, strlen(s));
#  311|   }
#  312|   

Error: CLANG_WARNING: [#def171]
git-2.45.2-build/git-2.45.2/diffcore-rename.c:15: included_from: Included from here.
git-2.45.2-build/git-2.45.2/strmap.h:189:10: warning[core.NullDereference]: Access to field 'default_value' results in a dereference of a null pointer (loaded from variable 'map')
#  187|   	struct strmap_entry *result = strmap_get_entry(&map->map, str);
#  188|   	if (!result)
#  189|-> 		return map->default_value;
#  190|   	return (intptr_t)result->value;
#  191|   }

Error: CLANG_WARNING: [#def172]
git-2.45.2-build/git-2.45.2/strvec.c:19:24: warning[core.NullDereference]: Array access (via field 'v') results in a null pointer dereference
#   17|   
#   18|   	ALLOC_GROW(array->v, array->nr + 2, array->alloc);
#   19|-> 	array->v[array->nr++] = value;
#   20|   	array->v[array->nr] = NULL;
#   21|   }

Error: CLANG_WARNING: [#def173]
git-2.45.2-build/git-2.45.2/t/helper/test-lazy-init-name-hash.c:215:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  213|   	prefix = setup_git_directory();
#  214|   
#  215|-> 	argc = parse_options(argc, argv, prefix, options, usage, 0);
#  216|   
#  217|   	/*

Error: CLANG_WARNING: [#def174]
git-2.45.2-build/git-2.45.2/t/helper/test-run-command.c:435:3: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  433|   	if (!strcmp(argv[1], "--ungroup")) {
#  434|   		argv += 1;
#  435|-> 		argc -= 1;
#  436|   		opts.ungroup = 1;
#  437|   	}

Error: CLANG_WARNING: [#def175]
git-2.45.2-build/git-2.45.2/t/helper/test-serve-v2.c:26:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#   24|   
#   25|   	/* ignore all unknown cmdline switches for now */
#   26|-> 	argc = parse_options(argc, argv, prefix, options, serve_usage,
#   27|   			     PARSE_OPT_KEEP_DASHDASH |
#   28|   			     PARSE_OPT_KEEP_UNKNOWN_OPT);

Error: CLANG_WARNING: [#def176]
git-2.45.2-build/git-2.45.2/t/helper/test-simple-ipc.c:626:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  624|   	argv++;
#  625|   
#  626|-> 	argc = parse_options(argc, argv, NULL, options, simple_ipc_usage, 0);
#  627|   
#  628|   	if (cl_args.nr_threads < 1)

Error: CLANG_WARNING: [#def177]
git-2.45.2-build/git-2.45.2/t/unit-tests/t-strbuf.c:34:7: warning[core.NullDereference]: Array access (via field 'buf') results in a null pointer dereference
#   32|   		return 0;
#   33|   	/* Buffers should always be NUL-terminated */
#   34|-> 	if (!check_char(buf->buf[buf->len], ==, '\0'))
#   35|   		return 0;
#   36|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def178]
git-2.45.2-build/git-2.45.2/tempfile.c: scope_hint: In function ‘fdopen_tempfile’
git-2.45.2-build/git-2.45.2/tempfile.c:272:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopen(*tempfile.fd,  mode)’
#  270|   
#  271|   	tempfile->fp = fdopen(tempfile->fd, mode);
#  272|-> 	return tempfile->fp;
#  273|   }
#  274|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def179]
git-2.45.2-build/git-2.45.2/tempfile.c: scope_hint: In function ‘reopen_tempfile’
git-2.45.2-build/git-2.45.2/tempfile.c:331:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*tempfile.filename.buf, 513)’
#  329|   		BUG("reopen_tempfile called for an open object");
#  330|   	tempfile->fd = open(tempfile->filename.buf, O_WRONLY|O_TRUNC);
#  331|-> 	return tempfile->fd;
#  332|   }
#  333|   

Error: CLANG_WARNING: [#def180]
git-2.45.2-build/git-2.45.2/trailer.c:328:8: warning[unix.Malloc]: Use of memory after it is freed
#  326|   	list_for_each_dir(pos, head, backwards) {
#  327|   		in_tok = list_entry(pos, struct trailer_item, list);
#  328|-> 		if (!same_token(in_tok, arg_tok))
#  329|   			continue;
#  330|   		on_tok = middle ? in_tok : start_tok;

Error: CLANG_WARNING: [#def181]
git-2.45.2-build/git-2.45.2/transport.c:980:6: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  978|   {
#  979|   	struct stat buf;
#  980|-> 	if (stat(url, &buf))
#  981|   		return 0;
#  982|   	return S_ISREG(buf.st_mode);

Error: CLANG_WARNING: [#def182]
git-2.45.2-build/git-2.45.2/transport.c:987:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  985|   static int external_specification_len(const char *url)
#  986|   {
#  987|-> 	return strchr(url, ':') - url;
#  988|   }
#  989|   

Error: CLANG_WARNING: [#def183]
git-2.45.2-build/git-2.45.2/unpack-trees.c:2062:4: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 2060|   			if (o->internal.show_all_errors)
# 2061|   				display_warning_msgs(o);
# 2062|-> 			ret = 0;
# 2063|   		}
# 2064|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def184]
git-2.45.2-build/git-2.45.2/tree.h:4: included_from: Included from here.
git-2.45.2-build/git-2.45.2/unpack-trees.c:11: included_from: Included from here.
git-2.45.2-build/git-2.45.2/unpack-trees.c: scope_hint: In function ‘verify_clean_subdirectory’
git-2.45.2-build/git-2.45.2/unpack-trees.c:2319:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ce’
git-2.45.2-build/git-2.45.2/object.h:117:28: note: in definition of macro ‘S_ISGITLINK’
git-2.45.2-build/git-2.45.2/unpack-trees.h:5: included_from: Included from here.
git-2.45.2-build/git-2.45.2/unpack-trees.c:14: included_from: Included from here.
git-2.45.2-build/git-2.45.2/unpack-trees.c:2482:44: note: in expansion of macro ‘ce_namelen’
git-2.45.2-build/git-2.45.2/object.h:117:28: note: in definition of macro ‘S_ISGITLINK’
# 2317|   	int cnt = 0;
# 2318|   
# 2319|-> 	if (S_ISGITLINK(ce->ce_mode)) {
# 2320|   		struct object_id oid;
# 2321|   		int sub_head = resolve_gitlink_ref(ce->name, "HEAD", &oid);

Error: CLANG_WARNING: [#def185]
git-2.45.2-build/git-2.45.2/unpack-trees.c:2475:8: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
# 2473|   		/* Avoid nuking startup_info->original_cwd... */
# 2474|   		if (startup_info->original_cwd &&
# 2475|-> 		    !strcmp(startup_info->original_cwd, ce->name))
# 2476|   			return add_rejected_path(o, ERROR_CWD_IN_THE_WAY,
# 2477|   						 ce->name);

Error: CLANG_WARNING: [#def186]
git-2.45.2-build/git-2.45.2/unpack-trees.c:2482:37: warning[core.NullDereference]: Access to field 'ce_namelen' results in a dereference of a null pointer (loaded from variable 'ce')
# 2480|   	}
# 2481|   
# 2482|-> 	len = check_leading_path(ce->name, ce_namelen(ce), 0);
# 2483|   	if (!len)
# 2484|   		return 0;

Error: CLANG_WARNING: [#def187]
git-2.45.2-build/git-2.45.2/unpack-trees.c:2523:35: warning[core.NullDereference]: Access to field 'ce_flags' results in a dereference of a null pointer (loaded from variable 'ce')
# 2521|   			 struct unpack_trees_options *o)
# 2522|   {
# 2523|-> 	if (!o->skip_sparse_checkout && (ce->ce_flags & CE_NEW_SKIP_WORKTREE))
# 2524|   		return 0;
# 2525|   	return verify_absent_1(ce, error_type, COMPLETELY_ABSENT, o);

Error: CLANG_WARNING: [#def188]
git-2.45.2-build/git-2.45.2/upload-pack.c:714:10: warning[deadcode.DeadStores]: Although the value stored to 'i' is used in the enclosing expression, the value is never actually read from 'i'
#  712|   		return -1;
#  713|   
#  714|-> 	while ((i = read_in_full(cmd.out, namebuf, hexsz + 1)) == hexsz + 1) {
#  715|   		struct object_id oid;
#  716|   		const char *p;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def189]
git-2.45.2-build/git-2.45.2/utf8.c: scope_hint: In function ‘pick_one_utf8_char’
git-2.45.2-build/git-2.45.2/utf8.c:135:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘s’
git-2.45.2-build/git-2.45.2/git-compat-util.h:1258: included_from: Included from here.
git-2.45.2-build/git-2.45.2/utf8.c:1: included_from: Included from here.
git-2.45.2-build/git-2.45.2/utf8.c:749:21: note: in expansion of macro ‘tolower’
git-2.45.2-build/git-2.45.2/utf8.c:749:21: note: in expansion of macro ‘tolower’
#  133|   	if (remainder < 1) {
#  134|   		goto invalid;
#  135|-> 	} else if (*s < 0x80) {
#  136|   		/* 0xxxxxxx */
#  137|   		ch = *s;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def190]
git-2.45.2-build/git-2.45.2/builtin/fast-export.c:23: included_from: Included from here.
git-2.45.2-build/git-2.45.2/utf8.h: scope_hint: In function ‘reencode_string’
git-2.45.2-build/git-2.45.2/utf8.h:45:16: warning[-Wanalyzer-null-argument]: use of NULL ‘in’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
#   43|   				    const char *in_encoding)
#   44|   {
#   45|-> 	return reencode_string_len(in, strlen(in),
#   46|   				   out_encoding, in_encoding,
#   47|   				   NULL);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def191]
git-2.45.2-build/git-2.45.2/worktree.c: scope_hint: In function ‘should_prune_worktree’
git-2.45.2-build/git-2.45.2/worktree.c:764:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(git_path("worktrees/%s/gitdir", id), 0)’
#  762|   		return 1;
#  763|   	}
#  764|-> 	len = xsize_t(st.st_size);
#  765|   	path = xmallocz(len);
#  766|   

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-230.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namegit-2.45.2-1.fc41
store-results-to/tmp/tmpr9qf5v57/git-2.45.2-1.fc41.tar.xz
time-created2024-07-03 12:53:30
time-finished2024-07-03 13:01:40
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpr9qf5v57/git-2.45.2-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpr9qf5v57/git-2.45.2-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9