]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1023: Coverity complains about dereferencing NULL pointer v9.1.1023
authorChristian Brabandt <cb@256bit.org>
Thu, 16 Jan 2025 18:06:57 +0000 (19:06 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 16 Jan 2025 18:06:57 +0000 (19:06 +0100)
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>
src/diff.c
src/version.c

index 7e5664172050728183756bca7afd25eaf932cbfc..c348894ec946f2478723ab3a2e4b4b8e6444fc47 100644 (file)
@@ -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 &&
index f2d77568f8bcddbd980c2c7bcae87d07ec59d766..92bba85007ac4e0b618061d982607115d35c649a 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1023,
 /**/
     1022,
 /**/