commit 62f9156: [Minor] Log place where we got bad IP when checking maps

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jul 5 15:28:07 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-05 16:20:59 +0100
URL: https://github.com/rspamd/rspamd/commit/62f9156987d30770f5314041a6b0fb6c4383a460 (HEAD -> master)

[Minor] Log place where we got bad IP when checking maps

---
 src/lua/lua_map.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lua/lua_map.c b/src/lua/lua_map.c
index 9c90cdf55..b28543c07 100644
--- a/src/lua/lua_map.c
+++ b/src/lua/lua_map.c
@@ -781,7 +781,6 @@ lua_map_get_key (lua_State * L)
 
 			if (lua_type (L, 2) == LUA_TSTRING) {
 				const gchar *addr_str;
-				gsize len;
 
 				addr_str = luaL_checklstring (L, 2, &len);
 				addr = g_alloca (sizeof (*addr));
@@ -789,7 +788,8 @@ lua_map_get_key (lua_State * L)
 
 				if (!rspamd_parse_inet_address_ip (addr_str, len, addr->addr)) {
 					addr = NULL;
-					msg_err ("invalid ip address: %*s", (gint)len, addr_str);
+					msg_warn ("invalid ip address: %*s, when checking map: %s",
+							(gint)len, addr_str, map->map->name);
 				}
 			}
 			else if (lua_type (L, 2) == LUA_TUSERDATA) {
@@ -806,7 +806,7 @@ lua_map_get_key (lua_State * L)
 				}
 			}
 			else if (lua_type (L, 2) == LUA_TNUMBER) {
-				key_num = luaL_checknumber (L, 2);
+				key_num = luaL_checkinteger (L, 2);
 				key_num = htonl (key_num);
 			}
 


More information about the Commits mailing list