diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-11 12:31:06 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-11 12:31:06 +0000 |
commit | ad94be0d7234b84b2b7fb3a90af6110301dd52e8 (patch) | |
tree | 87c8b441bc6861a7800441c559ec057e1b6ace5e /src/libstat | |
parent | ba7add76d59393b293e3a60325d929cf81cf16f2 (diff) | |
download | rspamd-ad94be0d7234b84b2b7fb3a90af6110301dd52e8.tar.gz rspamd-ad94be0d7234b84b2b7fb3a90af6110301dd52e8.zip |
[Minor] Stat: Fail-safety fix for object expansion
Diffstat (limited to 'src/libstat')
-rw-r--r-- | src/libstat/backends/redis_backend.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 10d348ac9..d7402db98 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -151,7 +151,6 @@ rspamd_redis_expand_object (const gchar *pattern, GString *tb; const gchar *rcpt = NULL; gint err_idx; - gboolean expansion_errored = FALSE; g_assert (ctx != NULL); stcf = ctx->stcf; @@ -214,9 +213,6 @@ rspamd_redis_expand_object (const gchar *pattern, if (elt) { tlen += strlen (elt); } - else { - expansion_errored = TRUE; - } break; case 'r': @@ -230,9 +226,6 @@ rspamd_redis_expand_object (const gchar *pattern, if (elt) { tlen += strlen (elt); } - else { - expansion_errored = TRUE; - } break; case 'l': if (stcf->label) { @@ -277,8 +270,8 @@ rspamd_redis_expand_object (const gchar *pattern, } - if (target == NULL || task == NULL || expansion_errored) { - return tlen; + if (target == NULL || task == NULL) { + return -1; } *target = rspamd_mempool_alloc (task->task_pool, tlen + 1); @@ -1305,6 +1298,7 @@ rspamd_redis_parse_classifier_opts (struct redis_stat_ctx *backend, } else { backend->enable_users = FALSE; + backend->cbref_user = -1; } elt = ucl_object_lookup (obj, "prefix"); |