From: Vsevolod Stakhov Date: Fri, 8 Oct 2021 15:08:44 +0000 (+0100) Subject: [Minor] Do not push invalid real_ip for received X-Git-Tag: 3.1~70 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2ce612ba70309ab8024f878d33ade87565eca394;p=rspamd.git [Minor] Do not push invalid real_ip for received --- diff --git a/src/libmime/received.cxx b/src/libmime/received.cxx index 74d2e3574..6d3e7b796 100644 --- a/src/libmime/received.cxx +++ b/src/libmime/received.cxx @@ -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";