diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-26 09:19:05 +0200 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-26 09:19:16 +0200 |
commit | 3d5132aa9b9be9b3542362015c3ed9e7160d894f (patch) | |
tree | 4cd291ffc76749249e5c353556a78afb94739934 | |
parent | fc811374f8926d2679a4e247b1586f781d0fcefc (diff) | |
download | rspamd-3d5132aa9b9be9b3542362015c3ed9e7160d894f.tar.gz rspamd-3d5132aa9b9be9b3542362015c3ed9e7160d894f.zip |
[Minor] Fix warnings
-rw-r--r-- | src/controller.c | 2 | ||||
-rw-r--r-- | src/fuzzy_storage.c | 11 | ||||
-rw-r--r-- | src/libmime/archives.c | 4 | ||||
-rw-r--r-- | src/libserver/url.c | 2 | ||||
-rw-r--r-- | src/plugins/chartable.c | 2 | ||||
-rw-r--r-- | src/plugins/fuzzy_check.c | 2 |
6 files changed, 14 insertions, 9 deletions
diff --git a/src/controller.c b/src/controller.c index 6375c844b..8b5fdbaea 100644 --- a/src/controller.c +++ b/src/controller.c @@ -2435,7 +2435,6 @@ rspamd_controller_finish_handler (struct rspamd_http_connection_entry *conn_ent) struct rspamd_controller_session *session = conn_ent->ud; session->ctx->worker->srv->stat->control_connections_count++; - msg_debug_session ("destroy session %p", session); if (session->task != NULL) { rspamd_session_destroy (session->task->s); @@ -2443,6 +2442,7 @@ rspamd_controller_finish_handler (struct rspamd_http_connection_entry *conn_ent) if (session->pool) { rspamd_mempool_delete (session->pool); + msg_debug_session ("destroy session %p", session); } session->wrk->nconns --; diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index 47173ae07..770337ca5 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -1749,10 +1749,13 @@ rspamd_fuzzy_storage_stat (struct rspamd_main *rspamd_main, msg.msg_control = fdspace; msg.msg_controllen = sizeof (fdspace); cmsg = CMSG_FIRSTHDR (&msg); - cmsg->cmsg_level = SOL_SOCKET; - cmsg->cmsg_type = SCM_RIGHTS; - cmsg->cmsg_len = CMSG_LEN (sizeof (int)); - memcpy (CMSG_DATA (cmsg), &outfd, sizeof (int)); + + if (cmsg) { + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN (sizeof (int)); + memcpy (CMSG_DATA (cmsg), &outfd, sizeof (int)); + } } iov.iov_base = &rep; diff --git a/src/libmime/archives.c b/src/libmime/archives.c index 2bae067be..501f2a4a3 100644 --- a/src/libmime/archives.c +++ b/src/libmime/archives.c @@ -173,10 +173,10 @@ rspamd_archive_rar_read_vint (const guchar *start, gsize remain, guint64 *res) while (remain > 0 && shift <= 57) { if (*p & 0x80) { - t |= (*p & 0x7f) << shift; + t |= ((guint64)(*p & 0x7f)) << shift; } else { - t |= (*p & 0x7f) << shift; + t |= ((guint64)(*p & 0x7f)) << shift; p ++; break; } diff --git a/src/libserver/url.c b/src/libserver/url.c index 75b173c44..acddc464f 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -1240,7 +1240,7 @@ rspamd_url_is_ip (struct rspamd_url *uri, rspamd_mempool_t *pool) * Here we count number of octets encoded in this element */ for (i = 0; i < 4; i++) { - if ((t >> 8 * i) > 0) { + if ((t >> (8 * i)) > 0) { nshift += 8; } else { diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c index 2d2bbdcc5..bfc5d2378 100644 --- a/src/plugins/chartable.c +++ b/src/plugins/chartable.c @@ -259,7 +259,7 @@ static gdouble rspamd_chartable_process_word_ascii (struct rspamd_task *task, rspamd_ftok_t *w, gboolean is_url) { - const gchar *p, *end, *c; + const guchar *p, *end, *c; gdouble badness = 0.0; enum { ascii = 1, diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 54b27e650..8d1d1c226 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -2698,6 +2698,8 @@ fuzzy_lua_unlearn_handler (lua_State *L) gpointer k, v; struct fuzzy_mapping *map; + symbol = lua_tostring (L, 2); + for (cur = fuzzy_module_ctx->fuzzy_rules; cur != NULL && flag == 0; cur = g_list_next (cur)) { rule = cur->data; |