diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-27 17:45:41 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-27 17:45:41 +0100 |
commit | c1904b4f751ae59d9a48fab651f4a0e6a232375e (patch) | |
tree | cf2f2bb5259715765784e3379f15952702f05cb7 /src/lua/lua_sqlite3.c | |
parent | bf2e401ad6246569faff56ec69429451faf7bcbd (diff) | |
download | rspamd-c1904b4f751ae59d9a48fab651f4a0e6a232375e.tar.gz rspamd-c1904b4f751ae59d9a48fab651f4a0e6a232375e.zip |
[Fix] Fix various issues related to Lua stack manipulation
Issue: #841
Diffstat (limited to 'src/lua/lua_sqlite3.c')
-rw-r--r-- | src/lua/lua_sqlite3.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lua/lua_sqlite3.c b/src/lua/lua_sqlite3.c index 97b112ac4..4cb900dd9 100644 --- a/src/lua/lua_sqlite3.c +++ b/src/lua/lua_sqlite3.c @@ -266,7 +266,9 @@ lua_sqlite3_next_row (lua_State *L) } } - return 0; + lua_pushnil (L); + + return 1; } /*** @@ -294,7 +296,7 @@ lua_sqlite3_rows (lua_State *L) if (sqlite3_prepare_v2 (db, query, -1, &stmt, NULL) != SQLITE_OK) { msg_err ("cannot prepare query %s: %s", query, sqlite3_errmsg (db)); lua_pushstring (L, sqlite3_errmsg (db)); - lua_error (L); + return lua_error (L); } else { top = lua_gettop (L); |