diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-23 19:48:21 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-23 19:48:21 +0000 |
commit | 6a425ff3a6aac8dcd663b5d7647e9b372ddee0b6 (patch) | |
tree | 4a0e0d43b8fa8b62cc9ab39cac6e6762c7d08ee4 | |
parent | 24f07eac1dc9a73fdfcd60fca156ac7f5035b6c2 (diff) | |
download | rspamd-6a425ff3a6aac8dcd663b5d7647e9b372ddee0b6.tar.gz rspamd-6a425ff3a6aac8dcd663b5d7647e9b372ddee0b6.zip |
[Minor] Sync ffi defs
-rw-r--r-- | src/libutil/mem_pool.c | 2 | ||||
-rw-r--r-- | test/lua/unit/rfc2047.lua | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/mem_pool.c b/src/libutil/mem_pool.c index df8c3cb07..d17c72bb8 100644 --- a/src/libutil/mem_pool.c +++ b/src/libutil/mem_pool.c @@ -332,7 +332,7 @@ rspamd_mempool_new_ (gsize size, const gchar *tag, gint flags, const gchar *loc) struct rspamd_mempool_entry_point *entry = rspamd_mempool_get_entry (loc); gsize total_size; - if (size == 0) { + if (size == 0 && entry) { size = entry->cur_suggestion; } diff --git a/test/lua/unit/rfc2047.lua b/test/lua/unit/rfc2047.lua index 0b8baf624..6054c5ca2 100644 --- a/test/lua/unit/rfc2047.lua +++ b/test/lua/unit/rfc2047.lua @@ -29,7 +29,7 @@ context("RFC2047 decoding", function() ffi.cdef[[ const char * rspamd_mime_header_decode (void *pool, const char *in, size_t inlen); - void * rspamd_mempool_new_ (size_t sz, const char *name, const char *strloc); + void * rspamd_mempool_new_ (size_t sz, const char *name, int flags, const char *strloc); void rspamd_mempool_delete (void *pool); ]] @@ -46,7 +46,7 @@ context("RFC2047 decoding", function() {"=?windows-1251?B?xO7q8+zl7fIuc2NyLnV1ZQ==?=", "Документ.scr.uue"}, } - local pool = ffi.C.rspamd_mempool_new_(4096, "lua", "rfc2047.lua:49") + local pool = ffi.C.rspamd_mempool_new_(4096, "lua", 0, "rfc2047.lua:49") for _,c in ipairs(cases) do local res = ffi.C.rspamd_mime_header_decode(pool, c[1], #c[1]) @@ -60,7 +60,7 @@ context("RFC2047 decoding", function() end) test("Fuzz test for rfc2047 tokens", function() local util = require("rspamd_util") - local pool = ffi.C.rspamd_mempool_new_(4096, "lua", "rfc2047.lua:63") + local pool = ffi.C.rspamd_mempool_new_(4096, "lua", 0, "rfc2047.lua:63") local str = "Тест Тест Тест Тест Тест" for i = 0,1000 do |