summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-05-02 14:46:03 +0200
committerlouiz’ <louiz@louiz.org>2017-05-02 15:00:21 +0200
commit0a8a77e64ce4c314d8e6fa9eda8fc47f8cdef080 (patch)
treecb3782d98f6da1d803cdb17f9e4605890586644c
parentea65b43cc2ad17879332941293ead8e36a219800 (diff)
downloadbiboumi-0a8a77e64ce4c314d8e6fa9eda8fc47f8cdef080.tar.gz
biboumi-0a8a77e64ce4c314d8e6fa9eda8fc47f8cdef080.tar.bz2
biboumi-0a8a77e64ce4c314d8e6fa9eda8fc47f8cdef080.tar.xz
biboumi-0a8a77e64ce4c314d8e6fa9eda8fc47f8cdef080.zip
Fix a segmentation fault when connecting to a server without a port
fix #3260
-rw-r--r--CHANGELOG.rst6
-rw-r--r--packaging/biboumi.spec.cmake4
-rw-r--r--src/irc/irc_client.cpp5
3 files changed, 15 insertions, 0 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index f90700d..6f6f064 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -18,6 +18,12 @@ Version 5.0
- Botan’s TLS policies can be customized by the administrator, for each
IRC server, with simple text files.
+Version 4.3 - 2017-05-02
+========================
+
+ - Fix a segmentation fault that occured when trying to connect to an IRC
+ server without any port configured.
+
Version 4.2 - 2017-04-26
========================
diff --git a/packaging/biboumi.spec.cmake b/packaging/biboumi.spec.cmake
index fcf90c0..a92f9dc 100644
--- a/packaging/biboumi.spec.cmake
+++ b/packaging/biboumi.spec.cmake
@@ -62,6 +62,10 @@ make check %{?_smp_mflags}
* ${RPM_DATE} Le Coz Florent <louiz@louiz.org> - ${RPM_VERSION}-1
- Build latest git revision
+* Wed May 2 2017 Le Coz Florent <louiz@louiz.org> - 4.3-1
+- Fix a segmentation fault that occured when trying to connect
+ to an IRC server without any port configured.
+
* Wed Apr 26 2017 Le Coz Florent <louiz@louiz.org> - 4.2-1
- Fix a build issue when LiteSQL is absent from the system
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index 90fad75..31d6278 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -183,6 +183,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();