1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 12:34:19 +00:00

Fix possible crash on manual peer ban

This commit is contained in:
Christophe Dumez 2010-10-20 16:15:15 +00:00
parent f617b74bac
commit 354d968a94

View File

@ -407,9 +407,12 @@ class FilterParserThread : public QThread {
// First, import current filter
ip_filter filter = s->get_ip_filter();
foreach(const QString &ip, IPs) {
qDebug("Manual ban of peer %s", ip.toLocal8Bit().data());
address_v4 addr = address_v4::from_string(ip.toLocal8Bit().data());
filter.add_rule(addr, addr, ip_filter::blocked);
qDebug("Manual ban of peer %s", ip.toLocal8Bit().constData());
boost::system::error_code ec;
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);
}