diff options
| author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2026-07-10 11:39:27 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-07-10 08:13:54 -0700 |
| commit | 2fdcce115a5ce4fe3d025858f958b92ab1c4d20e (patch) | |
| tree | 9fdd449e0c499dfd4ecb7af87083cf3f4bdc9317 /git-commit-script | |
| parent | d07d09ee43b920f17d00a96ee29621e398136218 (diff) | |
remote: guard `remote_tracking()` against NULL remote
The `remote_tracking()` function unconditionally dereferences
`remote->fetch` without checking whether remote is NULL.
In practice, this never happens because the only caller (`apply_cas()`)
guards the calls to this function by checking the `use_tracking` and
`use_tracking_for_rest` attributes.
However, it requires quite involved reasoning to reach that conclusion,
and is therefore fragile. Just return -1 ("no tracking ref") when there
is no remote to work with.
Pointed out by Coverity.
Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-commit-script')
0 files changed, 0 insertions, 0 deletions
