]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix warnings
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 26 Oct 2016 07:19:05 +0000 (09:19 +0200)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 26 Oct 2016 07:19:16 +0000 (09:19 +0200)
src/controller.c
src/fuzzy_storage.c
src/libmime/archives.c
src/libserver/url.c
src/plugins/chartable.c
src/plugins/fuzzy_check.c

index 6375c844bdfcdf6fac7907d0a7c684eccf09112f..8b5fdbaead2c4a0e211cdd91f5c8b6e5d153262d 100644 (file)
@@ -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 --;
index 47173ae0712249baf68aa6022e442846deca63ba..770337ca5d716240672bd72de623a5724203f4c1 100644 (file)
@@ -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;
index 2bae067be9a71453439f4b5125e3bbb313f333db..501f2a4a3d0fbd343167bd5d06300e0f9de3f37c 100644 (file)
@@ -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;
                }
index 75b173c44c5aed0942333d19cd1250bec32b84c3..acddc464fd9c74b1958a3354dc2b32aef8569eb5 100644 (file)
@@ -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 {
index 2d2bbdcc56a58962e134d7ba921f8daf909237a3..bfc5d23788d1d66559a6617cc4268a05ded715c6 100644 (file)
@@ -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,
index 54b27e650a275fcc48144440607da9bf9c88f75e..8d1d1c2266d24ee020e790b4c7a01b50444b8c5f 100644 (file)
@@ -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;