diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-04-23 13:58:51 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-23 13:58:51 -0700 |
| commit | 480ddc566fd68556bcf824a1141d5dbef3e0701f (patch) | |
| tree | 7049aa4e03b27f0ac50f8f2be0c5eac1ac3087a6 | |
| parent | 29860f328274f1136cf1b3a81bacefe0cde10073 (diff) | |
| parent | 0f558141ed3b93b393151367b9569446cd24caab (diff) | |
| download | git-480ddc566fd68556bcf824a1141d5dbef3e0701f.tar.gz | |
Merge branch 'js/range-check-codeql-workaround'
Work around false positive from CodeQL checker.
* js/range-check-codeql-workaround:
read-cache: check range before dereferencing an array element
| -rw-r--r-- | read-cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/read-cache.c b/read-cache.c index 2f9e21c897..4cdc7bb661 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2686,8 +2686,8 @@ static int ce_write_entry(struct hashfile *f, struct cache_entry *ce, int common, to_remove, prefix_size; unsigned char to_remove_vi[16]; for (common = 0; - (ce->name[common] && - common < previous_name->len && + (common < previous_name->len && + ce->name[common] && ce->name[common] == previous_name->buf[common]); common++) ; /* still matching */ |
