summaryrefslogtreecommitdiff
path: root/libproxy/modules/ignore_domain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libproxy/modules/ignore_domain.cpp')
-rw-r--r--libproxy/modules/ignore_domain.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libproxy/modules/ignore_domain.cpp b/libproxy/modules/ignore_domain.cpp
index 9183bb2..d031db1 100644
--- a/libproxy/modules/ignore_domain.cpp
+++ b/libproxy/modules/ignore_domain.cpp
@@ -18,6 +18,7 @@
******************************************************************************/
#include <cstdio>
+#include <iostream> // For cerr
#include "../extension_ignore.hpp"
using namespace libproxy;
@@ -44,11 +45,11 @@ public:
return (iport == 0 || port == iport);
/* Endswith (.domain.com or .domain.com:80) */
- if (ihost[0] == '.' && host.find(ihost) == host.size() - ihost.size())
+ if (ihost[0] == '.' && host.find(ihost) == host.size() - ihost.size() && host.size() >= ihost.size())
return (iport == 0 || port == iport);
/* Glob (*.domain.com or *.domain.com:80) */
- if (ihost[0] == '*' && host.find(ihost.substr(1)) == host.size() - ihost.substr(1).size())
+ if (ihost[0] == '*' && host.find(ihost.substr(1)) == host.size() - ihost.substr(1).size() && host.size() >= ihost.substr(1).size())
return (iport == 0 || port == iport);
/* No match was found */