Skip to content

Commit 480ddc5

Browse files
committed
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
2 parents 29860f3 + 0f55814 commit 480ddc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

read-cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,8 +2686,8 @@ static int ce_write_entry(struct hashfile *f, struct cache_entry *ce,
26862686
int common, to_remove, prefix_size;
26872687
unsigned char to_remove_vi[16];
26882688
for (common = 0;
2689-
(ce->name[common] &&
2690-
common < previous_name->len &&
2689+
(common < previous_name->len &&
2690+
ce->name[common] &&
26912691
ce->name[common] == previous_name->buf[common]);
26922692
common++)
26932693
; /* still matching */

0 commit comments

Comments
 (0)