]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not push invalid real_ip for received
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 8 Oct 2021 15:08:44 +0000 (16:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 8 Oct 2021 15:08:44 +0000 (16:08 +0100)
src/libmime/received.cxx

index 74d2e3574d34013753ac12b132adbb5454729574..6d3e7b7963efd6b2460a49db18b403cadc324fc0 100644 (file)
@@ -816,7 +816,12 @@ received_export_to_lua(received_header_chain *chain, lua_State *L) -> bool
                push_nullable_string(rh.by_hostname, "by_hostname");
                push_nullable_string(rh.for_mbox, "for");
 
-               rspamd_lua_ip_push (L, rh.addr);
+               if (rh.addr) {
+                       rspamd_lua_ip_push(L, rh.addr);
+               }
+               else {
+                       lua_pushnil(L);
+               }
                lua_setfield(L, -2, "real_ip");
 
                const auto *proto = "unknown";