mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 00:47:21 -06:00
Made IP filter more robust
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
* Unknown - Christophe DUMEZ <chris@qbittorrent.org> - 1.3.5
|
||||||
|
- BUGFIX: Made IP filter parser more robust
|
||||||
|
|
||||||
* Sun Jul 12 2009 - Christophe DUMEZ <chris@qbittorrent.org> - v1.3.4
|
* Sun Jul 12 2009 - Christophe DUMEZ <chris@qbittorrent.org> - v1.3.4
|
||||||
- BUGFIX: Fixed IP filter file parsing on 64bits
|
- BUGFIX: Fixed IP filter file parsing on 64bits
|
||||||
- BUGFIX: Suppressed QLayout: Attempting to add QLayout "" to properties "properties" warning message when opening a properties dialog
|
- BUGFIX: Suppressed QLayout: Attempting to add QLayout "" to properties "properties" warning message when opening a properties dialog
|
||||||
|
|||||||
@@ -191,8 +191,12 @@ class FilterParserThread : public QThread {
|
|||||||
if(IPv4) {
|
if(IPv4) {
|
||||||
//IPv4 addresses
|
//IPv4 addresses
|
||||||
IP = strStartIP.split('.');
|
IP = strStartIP.split('.');
|
||||||
|
if(IP.size() != 4)
|
||||||
|
throw exception();
|
||||||
address_v4 start((IP.at(0).toUInt() << 24) + (IP.at(1).toUInt() << 16) + (IP.at(2).toUInt() << 8) + IP.at(3).toUInt());
|
address_v4 start((IP.at(0).toUInt() << 24) + (IP.at(1).toUInt() << 16) + (IP.at(2).toUInt() << 8) + IP.at(3).toUInt());
|
||||||
IP = strEndIP.split('.');
|
IP = strEndIP.split('.');
|
||||||
|
if(IP.size() != 4)
|
||||||
|
throw exception();
|
||||||
address_v4 last((IP.at(0).toUInt() << 24) + (IP.at(1).toUInt() << 16) + (IP.at(2).toUInt() << 8) + IP.at(3).toUInt());
|
address_v4 last((IP.at(0).toUInt() << 24) + (IP.at(1).toUInt() << 16) + (IP.at(2).toUInt() << 8) + IP.at(3).toUInt());
|
||||||
// Apply to bittorrent session
|
// Apply to bittorrent session
|
||||||
filter.add_rule(start, last, ip_filter::blocked);
|
filter.add_rule(start, last, ip_filter::blocked);
|
||||||
|
|||||||
Reference in New Issue
Block a user