diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-10-08 13:50:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-08 13:50:29 +0200 |
commit | 93d33ed02eddd38771bfc1ab0d69e63a9491ace4 (patch) | |
tree | 2a4c77b129cd97cf03b61793285ea9d300cb618a /src | |
parent | 7f93b2ab01c93720820712a3c81462a58d04dfa0 (diff) | |
parent | 6064376f6d06067e6e633e1e16312d143e53b500 (diff) | |
download | rneovim-93d33ed02eddd38771bfc1ab0d69e63a9491ace4.tar.gz rneovim-93d33ed02eddd38771bfc1ab0d69e63a9491ace4.tar.bz2 rneovim-93d33ed02eddd38771bfc1ab0d69e63a9491ace4.zip |
Merge pull request #15954 from virchau13/fix-table-validation
fix(api): check type in nlua_pop_keydict (fixes #15940)
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/lua/converter.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c index fd4cfc4c31..ca3c4f604a 100644 --- a/src/nvim/lua/converter.c +++ b/src/nvim/lua/converter.c @@ -1303,6 +1303,12 @@ void nlua_init_types(lua_State *const lstate) void nlua_pop_keydict(lua_State *L, void *retval, field_hash hashy, Error *err) { + if (!lua_istable(L, -1)) { + api_set_error(err, kErrorTypeValidation, "Expected lua table"); + lua_pop(L, -1); + return; + } + lua_pushnil(L); // [dict, nil] while (lua_next(L, -2)) { // [dict, key, value] |