]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0166: Coverity warning for potential NULL dereference v9.2.0166
authorChristian Brabandt <cb@256bit.org>
Sat, 14 Mar 2026 17:27:47 +0000 (17:27 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 14 Mar 2026 17:27:47 +0000 (17:27 +0000)
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 <cb@256bit.org>
src/channel.c
src/version.c

index 78a462cc97e8b595bce65da1b7d757306ed02179..f35cbf8eadbb6ac40438243b6dceb4250fbef370 100644 (file)
@@ -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);
 
index b3d68918b38251ec81e283cf75407a593c3c0a75..ddf2d64bdb600af1a3a437e8bffbcbae8f1d3f56 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    166,
 /**/
     165,
 /**/