From a9f77be9223f8b886d89f7fac778d363586beb85 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Thu, 16 Jan 2025 19:06:57 +0100 Subject: [PATCH] patch 9.1.1023: Coverity complains about dereferencing NULL pointer Problem: Coverity complains about dereferencing NULL pointer Solution: Verify curdiff is not null before dereferencing it closes: #16437 Signed-off-by: Christian Brabandt --- src/diff.c | 7 +++++-- src/version.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/diff.c b/src/diff.c index 7e56641720..c348894ec9 100644 --- a/src/diff.c +++ b/src/diff.c @@ -2062,8 +2062,11 @@ count_filler_lines_and_topline( else { (*linesfiller) = 0; - ch_virtual_lines = get_max_diff_length(curdif); - isfiller = (curdif->df_count[toidx] ? FALSE : TRUE); + if (curdif) + { + ch_virtual_lines = get_max_diff_length(curdif); + isfiller = (curdif->df_count[toidx] ? FALSE : TRUE); + } if (isfiller) { while (curdif && curdif->df_next && diff --git a/src/version.c b/src/version.c index f2d77568f8..92bba85007 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1023, /**/ 1022, /**/