summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-05-02 14:46:03 +0200
committerlouiz’ <louiz@louiz.org>2017-05-02 14:46:03 +0200
commit25d46924bc2edd079d4d996d1d76d702d724341e (patch)
treec5f70e398ebf61472071735d1023cf282fc1a332
parent9db89eb8b0daada627f1c5b934e5407d37888371 (diff)
downloadbiboumi-4.3.tar.gz
biboumi-4.3.tar.bz2
biboumi-4.3.tar.xz
biboumi-4.3.zip
Fix a segmentation fault when connecting to a server without a port4.3v4
fix #3260
-rw-r--r--CHANGELOG.rst6
-rw-r--r--CMakeLists.txt2
-rw-r--r--packaging/biboumi.spec.cmake4
-rw-r--r--src/irc/irc_client.cpp5
4 files changed, 16 insertions, 1 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8a2c55d..911dfa3 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,9 @@
+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/CMakeLists.txt b/CMakeLists.txt
index be11e64..ca5aa97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0)
project(biboumi)
set(${PROJECT_NAME}_VERSION_MAJOR 4)
-set(${PROJECT_NAME}_VERSION_MINOR 2)
+set(${PROJECT_NAME}_VERSION_MINOR 3)
set(${PROJECT_NAME}_VERSION_SUFFIX "")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -pedantic -Wall -Wextra")
diff --git a/packaging/biboumi.spec.cmake b/packaging/biboumi.spec.cmake
index 8c34bd6..e4a1d3b 100644
--- a/packaging/biboumi.spec.cmake
+++ b/packaging/biboumi.spec.cmake
@@ -59,6 +59,10 @@ make check %{?_smp_mflags}
%changelog
+* 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 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();