aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-02 15:02:55 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-02 15:02:55 +0100
commit40f832e8adbf639e7467ff6c436a54ac3dc43882 (patch)
tree34483917143d1319e5e468da194216c5ce55272d
parent26832a9237178a763d57034c9e9636da0d6d8c7b (diff)
downloadrspamd-40f832e8adbf639e7467ff6c436a54ac3dc43882.tar.gz
rspamd-40f832e8adbf639e7467ff6c436a54ac3dc43882.zip
Fix warnings.
-rw-r--r--src/libserver/spf.c4
-rw-r--r--src/libstat/backends/mmaped_file.c15
-rw-r--r--src/libutil/expression.c2
-rw-r--r--src/lua/lua_task.c2
4 files changed, 12 insertions, 11 deletions
diff --git a/src/libserver/spf.c b/src/libserver/spf.c
index 7ba714583..f324454ae 100644
--- a/src/libserver/spf.c
+++ b/src/libserver/spf.c
@@ -230,7 +230,7 @@ rspamd_spf_process_reference (struct spf_resolved *target,
struct spf_addr *addr, struct spf_record *rec, gboolean top)
{
struct spf_resolved_element *elt;
- struct spf_addr *cur, taddr;
+ struct spf_addr *cur = NULL, taddr;
guint i;
if (addr) {
@@ -252,6 +252,7 @@ rspamd_spf_process_reference (struct spf_resolved *target,
}
}
+ g_assert (cur != NULL);
if (!(cur->flags & RSPAMD_SPF_FLAG_PARSED)) {
/* Unresolved redirect */
msg_info ("redirect to %s cannot be resolved", cur->spf_string);
@@ -630,6 +631,7 @@ parse_spf_domain_mask (struct spf_record *rec, struct spf_addr *addr,
resolved = g_ptr_array_index (rec->resolved, rec->resolved->len - 1);
host = resolved->cur_domain;
+ c = p;
while (*p) {
t = *p;
diff --git a/src/libstat/backends/mmaped_file.c b/src/libstat/backends/mmaped_file.c
index aab678ff5..b5d8ea642 100644
--- a/src/libstat/backends/mmaped_file.c
+++ b/src/libstat/backends/mmaped_file.c
@@ -913,16 +913,15 @@ rspamd_mmaped_file_runtime (struct rspamd_task *task,
filename = ucl_object_tostring (filenameo);
- if (learn) {
-
+ sizeo = ucl_object_find_key (stcf->opts, "size");
+ if (sizeo == NULL || ucl_object_type (sizeo) != UCL_INT) {
+ msg_err ("statfile %s has no size defined", stcf->symbol);
+ return NULL;
+ }
- sizeo = ucl_object_find_key (stcf->opts, "size");
- if (sizeo == NULL || ucl_object_type (sizeo) != UCL_INT) {
- msg_err ("statfile %s has no size defined", stcf->symbol);
- return NULL;
- }
+ size = ucl_object_toint (sizeo);
- size = ucl_object_toint (sizeo);
+ if (learn) {
rspamd_mmaped_file_create (ctx, filename, size, stcf);
}
diff --git a/src/libutil/expression.c b/src/libutil/expression.c
index 359bc2af7..9acef5e86 100644
--- a/src/libutil/expression.c
+++ b/src/libutil/expression.c
@@ -837,7 +837,7 @@ static gint
rspamd_ast_process_node (struct rspamd_expression *expr, gint flags, GNode *node,
gpointer data)
{
- struct rspamd_expression_elt *elt, *celt, *parelt;
+ struct rspamd_expression_elt *elt, *celt, *parelt = NULL;
GNode *cld;
gint acc = G_MININT, lim = G_MININT, val;
gdouble t1, t2;
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index c4e595c8b..ef05102c5 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -1247,7 +1247,7 @@ lua_task_get_queue_id (lua_State *L)
{
struct rspamd_task *task = lua_check_task (L, 1);
- if (task && task->queue_id != NULL && task->queue_id != "undef") {
+ if (task && task->queue_id != NULL && strcmp (task->queue_id, "undef") != 0) {
lua_pushstring (L, task->queue_id);
return 1;
}