diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-05-24 13:11:52 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-05-24 13:11:52 +0100 |
commit | 3b025570d4fd2bdd92c1a588ae494c4e2aa4db43 (patch) | |
tree | 5b325e29585bfc408ad9ea0bf13cdd55913e6820 | |
parent | 08466d29088eff168eb153bef4aad59f02312a21 (diff) | |
download | rspamd-3b025570d4fd2bdd92c1a588ae494c4e2aa4db43.tar.gz rspamd-3b025570d4fd2bdd92c1a588ae494c4e2aa4db43.zip |
Fix several potential problems found by static analysis.
-rw-r--r-- | src/cfg_xml.c | 10 | ||||
-rw-r--r-- | src/dkim.c | 4 | ||||
-rw-r--r-- | src/expressions.h | 2 | ||||
-rw-r--r-- | src/lua/lua_buffer.c | 2 |
4 files changed, 12 insertions, 6 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c index 322772825..054377059 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -897,8 +897,10 @@ worker_foreach_callback (gpointer k, gpointer v, gpointer ud) GList *cur; GHashTable *worker_config; - if (!worker_options || (worker_config = g_hash_table_lookup (worker_options, &cd->wrk->type)) == NULL || - (cparam = g_hash_table_lookup (worker_config, k)) == NULL) { + if (!worker_options || (worker_config = g_hash_table_lookup (worker_options, &cd->wrk->type)) == NULL) { + return; + } + if ((cparam = g_hash_table_lookup (worker_config, k)) == NULL) { /* Try to use universal handler if there is no specific handler */ if ((cparam = g_hash_table_lookup (worker_config, "*")) != NULL) { if (cd->wrk->ctx != NULL) { @@ -1114,6 +1116,10 @@ handle_metric_symbol (struct config_file *cfg, struct rspamd_xml_userdata *ctx, group = "ungrouped"; } } + else { + group = "ungrouped"; + sym_def->description = NULL; + } g_hash_table_insert (metric->symbols, sym_def->name, value); diff --git a/src/dkim.c b/src/dkim.c index feb11893d..157b13aee 100644 --- a/src/dkim.c +++ b/src/dkim.c @@ -579,14 +579,14 @@ rspamd_create_dkim_context (const gchar *sig, memory_pool_t *pool, guint time_ji } if (new->sig_alg == DKIM_SIGN_RSASHA1) { /* Check bh length */ - if (new->bhlen != g_checksum_type_get_length (G_CHECKSUM_SHA1)) { + if (new->bhlen != (guint)g_checksum_type_get_length (G_CHECKSUM_SHA1)) { g_set_error (err, DKIM_ERROR, DKIM_SIGERROR_BADSIG, "signature has incorrect length: %ud", new->bhlen); return NULL; } } else if (new->sig_alg == DKIM_SIGN_RSASHA256) { - if (new->bhlen != g_checksum_type_get_length (G_CHECKSUM_SHA256)) { + if (new->bhlen != (guint)g_checksum_type_get_length (G_CHECKSUM_SHA256)) { g_set_error (err, DKIM_ERROR, DKIM_SIGERROR_BADSIG, "signature has incorrect length: %ud", new->bhlen); return NULL; } diff --git a/src/expressions.h b/src/expressions.h index 6f42fa3e4..1ec3106c0 100644 --- a/src/expressions.h +++ b/src/expressions.h @@ -97,7 +97,7 @@ void re_cache_add (const gchar *line, void *pointer, memory_pool_t *pool); * @param line symbolic representation * @return pointer to regexp data or NULL if regexp is not found */ -void * re_cache_check (const const gchar *line, memory_pool_t *pool); +void * re_cache_check (const gchar *line, memory_pool_t *pool); /** * Remove regexp from regexp cache diff --git a/src/lua/lua_buffer.c b/src/lua/lua_buffer.c index b7a460b52..ee2b5d158 100644 --- a/src/lua/lua_buffer.c +++ b/src/lua/lua_buffer.c @@ -106,7 +106,7 @@ static gboolean lua_io_write_cb (void *arg) { struct lua_dispatcher_cbdata *cbdata = arg; - gboolean res; + gboolean res = FALSE; rspamd_io_dispatcher_t **pdispatcher; if (cbdata->cbref_write) { |