patch 9.1.1023: Coverity complains about dereferencing NULL pointer
Commit:
https://github.com/vim/vim/commit/a9f77be9223f8b886d89f7fac778d363586beb85
Author: Christian Brabandt <[email protected]>
Date: Thu Jan 16 19:06:57 2025 +0100
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 <[email protected]>
diff --git a/src/diff.c b/src/diff.c
index 7e5664172..c348894ec 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 f2d77568f..92bba8500 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,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1tYUOZ-00GO39-1Y%40256bit.org.