]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Lua_parsers: Use limit in rspamd_util.parse_mail_address
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 11 Jun 2021 16:26:12 +0000 (17:26 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 11 Jun 2021 16:26:12 +0000 (17:26 +0100)
src/lua/lua_parsers.c

index 6c75d8039092986b2ab927a4517e3b9c2c9fcc43..4180ac0d9c867ad08a9cc088dd0180777bc73033 100644 (file)
@@ -250,6 +250,7 @@ lua_parsers_parse_mail_address (lua_State *L)
        GPtrArray *addrs;
        gsize len;
        const gchar *str = luaL_checklstring (L, 1, &len);
+       gint max_addrs = luaL_optinteger(L, 2, 10240);
        rspamd_mempool_t *pool;
        gboolean own_pool = FALSE;
 
@@ -268,7 +269,7 @@ lua_parsers_parse_mail_address (lua_State *L)
                        own_pool = TRUE;
                }
 
-               addrs = rspamd_email_address_from_mime (pool, str, len, NULL, -1);
+               addrs = rspamd_email_address_from_mime (pool, str, len, NULL, max_addrs);
 
                if (addrs == NULL) {
                        lua_pushnil (L);