aboutsummaryrefslogtreecommitdiffstats
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-05-08 12:36:32 -0700
committerJunio C Hamano <gitster@pobox.com>2025-05-08 12:36:32 -0700
commit349083805e442cdad20f332a42c9e99e90c4c097 (patch)
tree8d5a221b94e71ace72f0ac45447dbc2c5b88b8e2 /diff.c
parentMerge branch 'ps/mv-contradiction-fix' (diff)
parentdiff: check range before dereferencing an array element (diff)
downloadgit-349083805e442cdad20f332a42c9e99e90c4c097.tar.gz
git-349083805e442cdad20f332a42c9e99e90c4c097.zip
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
Diffstat (limited to 'diff.c')
-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 */