From 7bd798029766d9bb610cfb07478ddaf94717324d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 13 Oct 2015 16:05:22 +0100 Subject: [PATCH] Fix parsing of HTTP headers with IP addresses --- src/libserver/protocol.c | 2 +- src/lua/lua_http.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index b721c3d62..a8a0c4785 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -389,7 +389,7 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, case 'i': case 'I': if (g_ascii_strncasecmp (headern, IP_ADDR_HEADER, hlen) == 0) { - if (!rspamd_parse_inet_address (&task->from_addr, hv->str, 0)) { + if (!rspamd_parse_inet_address (&task->from_addr, hv->str, hv->len)) { msg_err_task ("bad ip header: '%V'", hv); return FALSE; } diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c index 23adb6914..7390000e0 100644 --- a/src/lua/lua_http.c +++ b/src/lua/lua_http.c @@ -449,7 +449,7 @@ lua_http_request (lua_State *L) rspamd_session_watcher_push (session); } - if (rspamd_parse_inet_address (&cbd->addr, msg->host->str, 0)) { + if (rspamd_parse_inet_address (&cbd->addr, msg->host->str, msg->host->len)) { /* Host is numeric IP, no need to resolve */ if (!lua_http_make_connection (cbd)) { lua_http_maybe_free (cbd); -- 2.39.5