]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix parsing of forwarded IP
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Aug 2016 11:36:21 +0000 (12:36 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Aug 2016 11:36:21 +0000 (12:36 +0100)
src/controller.c

index e139881fea4b9bdda7534ec3444df276ff798d53..aecb6771f462c3662c43daf72450a0607e5c723a 100644 (file)
@@ -378,8 +378,8 @@ rspamd_controller_check_forwarded (struct rspamd_controller_session *session,
                else {
                        comma = hdr->begin;
                }
-               if (rspamd_parse_inet_address (&addr, hdr->begin,
-                               comma - hdr->begin)) {
+               if (rspamd_parse_inet_address (&addr, comma,
+                               (hdr->begin + hdr->len) - comma)) {
                        /* We have addr now, so check if it is still trusted */
                        if (ctx->secure_map &&
                                        radix_find_compressed_addr (ctx->secure_map,