Mercurial > dnsbl
diff src/scanner.cpp @ 272:a99b6c1f5f67
Code cleanup, increase minimum hostname length for uribl checking
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Mon, 09 Sep 2013 19:30:21 -0700 |
parents | f92f24950bd3 |
children | 1686cb639269 |
line wrap: on
line diff
--- a/src/scanner.cpp Mon Sep 09 15:20:38 2013 -0700 +++ b/src/scanner.cpp Mon Sep 09 19:30:21 2013 -0700 @@ -1257,8 +1257,9 @@ const char *p1 = strchr((const char *)pending, '.'); const char *p2 = strrchr((const char *)pending, '.'); const char *p3 = strstr((const char *)pending, ".."); - if (p1 && (p1 != (char*)pending) & !p3) { - // have a period, so at least two components, and no empty components + size_t n = strlen((const char *)pending); + if (p1 && (p1 != (char*)pending) && !p3 && (n > 6)) { + // have a period, so at least two components, and no empty components, and longer than 6 chars in_addr ip; if (inet_aton((const char*)pending, &ip)) { // have an ip address if at least two periods