From 25d46924bc2edd079d4d996d1d76d702d724341e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 2 May 2017 14:46:03 +0200 Subject: Fix a segmentation fault when connecting to a server without a port fix #3260 --- src/irc/irc_client.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index b0d3a47..de6b089 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -182,6 +182,11 @@ void IrcClient::start() { if (this->is_connecting() || this->is_connected()) return; + if (this->ports_to_try.empty()) + { + this->bridge.send_xmpp_message(this->hostname, "", "Can not connect to IRC server: no port specified."); + return; + } std::string port; bool tls; std::tie(port, tls) = this->ports_to_try.top(); -- cgit v1.2.3