Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/xname.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ openssl_new_xname(lua_State *L, int idx, int utf8)

for (i = 0, n = lua_rawlen(L, idx), ret = 1; i < n && ret == 1; i++) {
lua_rawgeti(L, idx, i + 1);
if (!lua_istable(L, -1)) {
/* guard: non-table array element (e.g. {"CN=x"}) would make lua_next
* treat a string as a table and crash the process (nil deref). */
ret = 0;
break;
}
lua_pushnil(L);

while (lua_next(L, -2) != 0) {
Expand Down
Loading