1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

irc: check that IRC URL starts with "irc" (issue #1903)

This commit is contained in:
Sébastien Helleu
2023-04-05 23:52:55 +02:00
parent 62171c5974
commit 9ccdc5aff6
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -1726,6 +1726,9 @@ irc_server_alloc_with_url (const char *irc_url)
if (!irc_url || !irc_url[0])
return NULL;
if (weechat_strncasecmp (irc_url, "irc", 3) != 0)
return NULL;
irc_url2 = strdup (irc_url);
if (!irc_url2)
return NULL;
+1 -1
View File
@@ -534,8 +534,8 @@ TEST(IrcServer, AllocWithUrl)
POINTERS_EQUAL(NULL, irc_server_alloc_with_url (NULL));
POINTERS_EQUAL(NULL, irc_server_alloc_with_url (""));
POINTERS_EQUAL(NULL, irc_server_alloc_with_url ("test"));
POINTERS_EQUAL(NULL, irc_server_alloc_with_url ("test://irc.example.org"));
/* address */
server = irc_server_alloc_with_url ("irc://irc.example.org");