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:
@@ -2686,8 +2686,8 @@ static int ce_write_entry(struct hashfile *f, struct cache_entry *ce,
|
|||||||
int common, to_remove, prefix_size;
|
int common, to_remove, prefix_size;
|
||||||
unsigned char to_remove_vi[16];
|
unsigned char to_remove_vi[16];
|
||||||
for (common = 0;
|
for (common = 0;
|
||||||
(ce->name[common] &&
|
(common < previous_name->len &&
|
||||||
common < previous_name->len &&
|
ce->name[common] &&
|
||||||
ce->name[common] == previous_name->buf[common]);
|
ce->name[common] == previous_name->buf[common]);
|
||||||
common++)
|
common++)
|
||||||
; /* still matching */
|
; /* still matching */
|
||||||
|
|||||||
Reference in New Issue
Block a user