mirror of
https://github.com/vim/vim.git
synced 2026-05-28 00:21:37 +02:00
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 <cb@256bit.org>
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
166,
|
||||
/**/
|
||||
165,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user