diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-26 23:09:04 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-26 23:09:04 +0000 |
commit | fb62c00c3201e96106d6531d8e60d8a96e109a41 (patch) | |
tree | 946318cbf3683c36fe9d2c023d04bcea04a5117e | |
parent | e56564c8b802166106d59fbd8f03103da5adb22c (diff) | |
download | rspamd-fb62c00c3201e96106d6531d8e60d8a96e109a41.tar.gz rspamd-fb62c00c3201e96106d6531d8e60d8a96e109a41.zip |
Avoid endless recursion while pushing ucl arrays to lua.
-rw-r--r-- | src/lua/lua_rcl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lua/lua_rcl.c b/src/lua/lua_rcl.c index cb5c46252..2768ac4a4 100644 --- a/src/lua/lua_rcl.c +++ b/src/lua/lua_rcl.c @@ -53,12 +53,12 @@ lua_rcl_obj_push_elt (lua_State *L, const char *key, ucl_object_t *obj) * @return */ static gint -lua_rcl_obj_push_obj (lua_State *L, ucl_object_t *obj) +lua_rcl_obj_push_obj (lua_State *L, ucl_object_t *obj, gboolean allow_array) { ucl_object_t *cur; ucl_object_iter_t it = NULL; - if (obj->next != NULL) { + if (allow_array && obj->next != NULL) { /* Actually we need to push this as an array */ return lua_rcl_obj_push_array (L, obj); } @@ -141,7 +141,7 @@ lua_rcl_obj_push (lua_State *L, ucl_object_t *obj, gboolean allow_array) { switch (obj->type) { case UCL_OBJECT: - return lua_rcl_obj_push_obj (L, obj); + return lua_rcl_obj_push_obj (L, obj, allow_array); case UCL_ARRAY: return lua_rcl_obj_push_array (L, obj->value.av); default: |