From c6836066bd90451f97c4db256385e23f2e922572 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 22 Mar 2016 13:07:30 +0000 Subject: [PATCH] [Fix] Fix crashes on arm32 --- src/libstat/backends/sqlite3_backend.c | 7 ++++--- src/libutil/str_util.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libstat/backends/sqlite3_backend.c b/src/libstat/backends/sqlite3_backend.c index 9d582e063..36bbaa20e 100644 --- a/src/libstat/backends/sqlite3_backend.c +++ b/src/libstat/backends/sqlite3_backend.c @@ -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); } diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index d79519c88..b114e3a90 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -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); -- 2.39.5