From 48c46dc79a46281614aaf2398e9b90bb1eb2a407 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Fri, 24 Nov 2017 01:03:11 +0200 Subject: [PATCH] Fix crash on some systems when creating address object for 255.255.255.255 Closes #7735. --- src/base/bittorrent/session.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 6cc4c92c9..7bd8306b4 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1418,8 +1418,11 @@ void Session::configure(libtorrent::settings_pack &settingsPack) void Session::configurePeerClasses() { libt::ip_filter f; - f.add_rule(libt::address_v4::from_string("0.0.0.0") - , libt::address_v4::from_string("255.255.255.255") + // address_v4::from_string("255.255.255.255") crashes on some people's systems + // so instead we use address_v4::broadcast() + // Proactively do the same for 0.0.0.0 and address_v4::any() + f.add_rule(libt::address_v4::any() + , libt::address_v4::broadcast() , 1 << libt::session::global_peer_class_id); #if TORRENT_USE_IPV6 // IPv6 may not be available on OS and the parsing