From 04127efebacaaa088668198cdbe52f933367b731 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 28 Sep 2019 13:37:22 +0100 Subject: [Fix] Distinguish remote and local addrs parsing --- src/libserver/cfg_rcl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libserver/cfg_rcl.c') diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index b219e1af8..cdf3d9b5b 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -3254,13 +3254,15 @@ rspamd_rcl_parse_struct_addr (rspamd_mempool_t *pool, struct rspamd_rcl_struct_parser *pd = ud; rspamd_inet_addr_t **target; const gchar *val; + gsize size; target = (rspamd_inet_addr_t **)(((gchar *)pd->user_struct) + pd->offset); if (ucl_object_type (obj) == UCL_STRING) { - val = ucl_object_tostring (obj); + val = ucl_object_tolstring (obj, &size); - if (!rspamd_parse_inet_address (target, val, strlen (val))) { + if (!rspamd_parse_inet_address (target, val, size, + RSPAMD_INET_ADDRESS_PARSE_DEFAULT)) { g_set_error (err, CFG_RCL_ERROR, EINVAL, -- cgit v1.2.3