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

Work around false positive given by CodeQL.

* js/diff-codeql-false-positive-workaround:
  diff: check range before dereferencing an array element
This commit is contained in:
Junio C Hamano
2025-05-08 12:36:32 -07:00

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