summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-server.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-01-27 20:47:24 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-01-28 15:14:22 +0100
commitc07cf691adb4740759e9fd128a2f6702c912d70f (patch)
tree91520d9be1270aae41d23ffeae1f69d3a31b10d2 /src/plugins/irc/irc-server.c
parentc9ac4fef4b7aa054df72bddf667edea0608d39c6 (diff)
downloadweechat-c07cf691adb4740759e9fd128a2f6702c912d70f.zip
core, plugins: check that string parameters are not NULL in search functions (issue #1872)
Diffstat (limited to 'src/plugins/irc/irc-server.c')
-rw-r--r--src/plugins/irc/irc-server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index f1f969acb..1c5726bc6 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -238,6 +238,9 @@ irc_server_search_casemapping (const char *casemapping)
{
int i;
+ if (!casemapping)
+ return -1;
+
for (i = 0; i < IRC_SERVER_NUM_CASEMAPPING; i++)
{
if (weechat_strcasecmp (irc_server_casemapping_string[i], casemapping) == 0)
@@ -260,6 +263,9 @@ irc_server_search_utf8mapping (const char *utf8mapping)
{
int i;
+ if (!utf8mapping)
+ return -1;
+
for (i = 0; i < IRC_SERVER_NUM_UTF8MAPPING; i++)
{
if (weechat_strcasecmp (irc_server_utf8mapping_string[i], utf8mapping) == 0)