Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter_lua: add index to arraylength call #8103

Merged
merged 1 commit into from
Nov 6, 2023
Merged
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
filter_lua: add index to arraylength call
When building with `FLB_FILTER_LUA_USE_MPACK`, compilation fails because
this `flb_lua_arraylength` call didn't have an index argument. This PR
passes the index argument to the function that I believe to be correct,
which is `-1` (assuming based on its usage in the following loop to get
individual elements).

Signed-off-by: braydonk <braydonk@google.com>
  • Loading branch information
braydonk committed Oct 28, 2023
commit 7d69223ef5c83390a54020e0ad0122de6d703e8e
2 changes: 1 addition & 1 deletion plugins/filter_lua/lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static void pack_result_mpack(lua_State *l,
return;
}

len = flb_lua_arraylength(l);
len = flb_lua_arraylength(l, -1);
if (len > 0) {
/* record split */
for (i = 1; i <= len; i++) {
Expand Down
Loading