0
0
mirror of https://github.com/vim/vim.git synced 2025-09-03 21:23:48 -04:00

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>
This commit is contained in:
Christian Brabandt 2025-01-16 19:06:57 +01:00
parent 9162e636b3
commit a9f77be922
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 7 additions and 2 deletions

View 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 &&

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1023,
/**/
1022,
/**/