patch 9.2.0166: Coverity warning for potential NULL dereference

Commit: 
https://github.com/vim/vim/commit/84c7a5d18fbce19291d08f8e26d78110fbc283e4
Author: Christian Brabandt <[email protected]>
Date:   Sat Mar 14 17:27:47 2026 +0000

    patch 9.2.0166: Coverity warning for potential NULL dereference
    
    Problem:  Coverity warning for potential NULL dereference in channel.c
              (after v9.2.0153)
    Solution: Use empty string in case hostname is NULL.
    
    CID: 1686330
    
    related: #19676
    
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/channel.c b/src/channel.c
index 78a462cc9..f35cbf8ea 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1594,7 +1594,7 @@ channel_listen(
     channel->ch_listen = TRUE;
     channel->CH_SOCK_FD = (sock_T)sd;
     channel->ch_nb_close_cb = nb_close_cb;
-    channel->ch_hostname = (char *)vim_strsave((char_u *)hostname);
+    channel->ch_hostname = (char *)vim_strsave((char_u *)(hostname != NULL ? 
hostname : ""));
     channel->ch_port = port_in;
     channel->ch_to_be_closed |= (1U << PART_SOCK);
 
diff --git a/src/version.c b/src/version.c
index b3d68918b..ddf2d64bd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    166,
 /**/
     165,
 /**/

-- 
-- 
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/E1w1T2y-005IA9-Ud%40256bit.org.

Raspunde prin e-mail lui