mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-09 09:02:31 -06:00
Fix possible crash on manual peer ban
This commit is contained in:
@@ -407,9 +407,12 @@ class FilterParserThread : public QThread {
|
|||||||
// First, import current filter
|
// First, import current filter
|
||||||
ip_filter filter = s->get_ip_filter();
|
ip_filter filter = s->get_ip_filter();
|
||||||
foreach(const QString &ip, IPs) {
|
foreach(const QString &ip, IPs) {
|
||||||
qDebug("Manual ban of peer %s", ip.toLocal8Bit().data());
|
qDebug("Manual ban of peer %s", ip.toLocal8Bit().constData());
|
||||||
address_v4 addr = address_v4::from_string(ip.toLocal8Bit().data());
|
boost::system::error_code ec;
|
||||||
filter.add_rule(addr, addr, ip_filter::blocked);
|
address_v4 addr = address_v4::from_string(ip.toLocal8Bit().constData(), ec);
|
||||||
|
Q_ASSERT(!ec);
|
||||||
|
if(!ec)
|
||||||
|
filter.add_rule(addr, addr, ip_filter::blocked);
|
||||||
}
|
}
|
||||||
s->set_ip_filter(filter);
|
s->set_ip_filter(filter);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user