url_text ++;
}
- if (rspamd_url_find (pool, url_text, end - url_text, &url_str, FALSE,
- &url_pos) &&
+ if (end > url_text + 4 &&
+ rspamd_url_find (pool, url_text, end - url_text, &url_str, FALSE,
+ &url_pos) &&
url_str != NULL) {
if (url_pos > 0) {
/*
if (*dend == '.') {
dend--;
}
+ if (nend <= nstart || dend <= dstart) {
+ return FALSE;
+ }
/* Now compare from end to start */
for (;;) {
msg_debug_spf ("ptr records mismatch: %s and %s", dend, nend);
return FALSE;
}
+
if (dend == dstart) {
break;
}
nend--;
dend--;
}
- if (nend != nstart && *(nend - 1) != '.') {
+
+ if (nend > nstart && *(nend - 1) != '.') {
/* Not a subdomain */
return FALSE;
}