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 <cb@256bit.org>
diff --git a/src/diff.c b/src/diff.c
index 7e56641..c348894 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -2062,8 +2062,11 @@
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 f2d7756..92bba85 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1023,
+/**/
1022,
/**/
1021,