aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-23 14:20:38 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-23 14:20:38 +0100
commitc137be80df707ffaf71d5d3ed1c38c20fc9b8e9a (patch)
treef68e0d0eeff2a5f3762495ff61779a80bd1b7881
parent86a83ea8f15d57e530b4fa937aa9e4720f3e7444 (diff)
downloadrspamd-c137be80df707ffaf71d5d3ed1c38c20fc9b8e9a.tar.gz
rspamd-c137be80df707ffaf71d5d3ed1c38c20fc9b8e9a.zip
Avoid non-portable lua integers.
-rw-r--r--src/lua/lua_config.c3
-rw-r--r--src/lua/lua_upstream.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 41b2e57f5..ae1f9b0f0 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -1478,7 +1478,8 @@ lua_radix_get_key (lua_State * L)
if (radix) {
if (lua_type (L, 2) == LUA_TNUMBER) {
- key_num = htonl (luaL_checkint (L, 2));
+ key_num = luaL_checknumber (L, 2);
+ key_num = htonl (key_num);
}
else if (lua_type (L, 2) == LUA_TUSERDATA) {
ud = luaL_checkudata (L, 2, "rspamd{ip}");
diff --git a/src/lua/lua_upstream.c b/src/lua/lua_upstream.c
index 31ced8103..0b2739903 100644
--- a/src/lua/lua_upstream.c
+++ b/src/lua/lua_upstream.c
@@ -184,7 +184,7 @@ lua_upstream_list_create (lua_State *L)
def = luaL_checkstring (L, 1);
if (def) {
if (lua_gettop (L) >= 2) {
- default_port = luaL_checkinteger (L, 2);
+ default_port = luaL_checknumber (L, 2);
}
tokens = g_strsplit_set (def, ",;", 0);