]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix crashes on arm32
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Mar 2016 13:07:30 +0000 (13:07 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Mar 2016 13:07:30 +0000 (13:07 +0000)
src/libstat/backends/sqlite3_backend.c
src/libutil/str_util.c

index 9d582e06380af0785e64b4fb7856ce22d8337441..36bbaa20e79bdc8e263dad6bef66b66ab5a40b35 100644 (file)
@@ -428,6 +428,7 @@ rspamd_sqlite3_opendb (rspamd_mempool_t *pool,
        struct rspamd_stat_tokenizer *tokenizer;
        gpointer tk_conf;
        gsize sz = 0;
+       gint64 sz64 = 0;
        gchar *tok_conf_encoded;
        gint ret, ntries = 0;
        const gint max_tries = 100;
@@ -476,8 +477,8 @@ rspamd_sqlite3_opendb (rspamd_mempool_t *pool,
        }
 
        if (rspamd_sqlite3_run_prstmt (pool, bk->sqlite, bk->prstmt,
-                       RSPAMD_STAT_BACKEND_LOAD_TOKENIZER, &sz, &tk_conf) != SQLITE_OK ||
-                       sz == 0) {
+                       RSPAMD_STAT_BACKEND_LOAD_TOKENIZER, &sz64, &tk_conf) != SQLITE_OK ||
+                       sz64 == 0) {
 
                msg_info_pool ("absent tokenizer conf in %s, creating a new one",
                                bk->fname);
@@ -1009,7 +1010,7 @@ rspamd_sqlite3_load_tokenizer_config (gpointer runtime,
        }
        else {
                /* Need to decode */
-               copied_conf = rspamd_decode_base32 (tk_conf, sz, &sz);
+               copied_conf = rspamd_decode_base32 (tk_conf, sz, len);
                g_free (tk_conf);
                rspamd_mempool_add_destructor (rt->task->task_pool, g_free, copied_conf);
        }
index d79519c888cb0cd2ffec28b3accfb1ddec18b9aa..b114e3a90ccca9345fa63d3fc1f3a9f91cf9faca 100644 (file)
@@ -632,7 +632,7 @@ rspamd_decode_base32 (const gchar *in, gsize inlen, gsize *outlen)
        guchar *res;
 
        gsize allocated_len = inlen * 5 / 8 + 2;
-       gint olen;
+       gssize olen;
 
        res = g_malloc (allocated_len);