aboutsummaryrefslogtreecommitdiffstats
diff options
authorJunio C Hamano <gitster@pobox.com>2025-05-01 14:07:57 -0700
committerJunio C Hamano <gitster@pobox.com>2025-05-01 14:07:57 -0700
commita8402760328a6f9879ce40263fe306538782a5b0 (patch)
tree5a4e678b36c538e5b8ad6f41da15efd1938b46e1
parent5c27b05f45c62536b04b42e8b6f92e2a86456c1b (diff)
parent104add8368617f80ee356ea48497364ed39a7b7a (diff)
downloadgit-next.tar.gz
Merge branch 'js/diff-codeql-false-positive-workaround' into nextnext
Work around false positive given by CodeQL. * js/diff-codeql-false-positive-workaround: diff: check range before dereferencing an array element
-rw-r--r--diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 63e9ecb30c..90e8003dd1 100644
--- a/diff.c
+++ b/diff.c
@@ -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 */