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:
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user