diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2019-08-03 10:18:25 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2019-08-03 10:53:17 +0200 |
commit | 478ca220540ddad75cba4f204e4ff68c1fb535ac (patch) | |
tree | 765e5a3e739f5970f923b50e58ca564934948748 /src/plugins/irc | |
parent | 1f52101a41553afffbd6e1d3bf44060fe6078ed6 (diff) | |
download | weechat-478ca220540ddad75cba4f204e4ff68c1fb535ac.zip |
irc: return NULL in function irc_message_get_address_from_host if the received host is NULL
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-message.c | 3 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index 8899bee53..afa999281 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -495,6 +495,9 @@ irc_message_get_address_from_host (const char *host) char host2[256], *pos_space, *pos; const char *ptr_host; + if (!host) + return NULL; + address[0] = '\0'; if (host) { diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index a68534cbc..b869e59d6 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -914,7 +914,7 @@ IRC_PROTOCOL_CALLBACK(chghost) nick, IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_HOST, - address, + (address) ? address : "", IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_MESSAGE_CHGHOST, IRC_COLOR_CHAT_HOST, |