commit 2944572: [Minor] Stop polluting logs on garbadge urls

Vsevolod Stakhov vsevolod at highsecure.ru
Sun Apr 18 19:42:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-04-18 20:40:38 +0100
URL: https://github.com/rspamd/rspamd/commit/2944572017edb0b5660eb311c9342d19c8737387 (HEAD -> master)

[Minor] Stop polluting logs on garbadge urls
Issue: #3688

---
 src/libserver/url.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libserver/url.c b/src/libserver/url.c
index a97db640a..6f62702b3 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -1803,7 +1803,7 @@ rspamd_url_is_ip (struct rspamd_url *uri, rspamd_mempool_t *pool)
 		end--;
 	}
 
-	if (end - p == 0) {
+	if (end - p == 0 || end - p > INET6_ADDRSTRLEN) {
 		return FALSE;
 	}
 
@@ -1832,7 +1832,7 @@ rspamd_url_is_ip (struct rspamd_url *uri, rspamd_mempool_t *pool)
 			if (shift < 32 &&
 				((*p == '.' && dots < 3) || (p == end && dots <= 3))) {
 				if (p - c + 1 >= (gint) sizeof (buf)) {
-					msg_err_pool ("invalid numeric url %*.s...: too long",
+					msg_debug_pool ("invalid numeric url %*.s...: too long",
 							INET6_ADDRSTRLEN, c);
 					return FALSE;
 				}


More information about the Commits mailing list