aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_rcl.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-28 13:37:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-28 13:37:22 +0100
commit04127efebacaaa088668198cdbe52f933367b731 (patch)
tree5e19bd17ac25d675666f53b19f746681a57e89da /src/libserver/cfg_rcl.c
parent8e5517a62b981fedc9e42d1323b066fadf086f1a (diff)
downloadrspamd-04127efebacaaa088668198cdbe52f933367b731.tar.gz
rspamd-04127efebacaaa088668198cdbe52f933367b731.zip
[Fix] Distinguish remote and local addrs parsing
Diffstat (limited to 'src/libserver/cfg_rcl.c')
-rw-r--r--src/libserver/cfg_rcl.c6
1 files changed, 4 insertions, 2 deletions
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,