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
This commit is contained in:
Junio C Hamano
2025-04-23 13:58:51 -07:00

View File

@@ -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 */