Merge branch 'js/diff-codeql-false-positive-workaround' into jch

Work around false positive given by CodeQL.

* js/diff-codeql-false-positive-workaround:
  diff: check range before dereferencing an array element
Junio C Hamano 2025-05-01 14:07:14 -07:00
commit b94ee9e1c7
1 changed files with 1 additions and 1 deletions

2
diff.c
View File

@ -892,7 +892,7 @@ static void fill_es_indent_data(struct emitted_diff_symbol *es)

/* skip any \v \f \r at start of indentation */
while (s[off] == '\f' || s[off] == '\v' ||
(s[off] == '\r' && off < len - 1))
(off < len - 1 && s[off] == '\r'))
off++;

/* calculate the visual width of indentation */