]> source.dussan.org Git - rspamd.git/commitdiff
Fix parsing of HTTP headers with IP addresses
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 13 Oct 2015 15:05:22 +0000 (16:05 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 13 Oct 2015 15:05:22 +0000 (16:05 +0100)
src/libserver/protocol.c
src/lua/lua_http.c

index b721c3d62489b5854fb5e2d4a1b71d4af3a9e265..a8a0c478516ad18f7f0e62cd848d38c1cc51d26b 100644 (file)
@@ -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;
                                }
index 23adb69148f432984123d39d7fc7fc22ad309721..7390000e0e571549c5074fecadd587bf8a3ede68 100644 (file)
@@ -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);