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

Lua: Fix stack level after register odkim functions. #201

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

futatuki
Copy link

When luaL_setfuncs() is replaced by luaL_newlib() + lua_setglobal() in commit 74b3374, the commit did not take account that lua_setglobal() pops a value from the stack.

Thus, following lua pop(l, 1) tries to pop from empty stack in Lua >= 5.2, especially in Lua 5.4, it causes abort().

This fix it.

  • miltertest/miltertest.c (main): Don't pop after lua_setglobal() in Lua >= 5.2

  • opendkim/opendkim-lua.c (dkimf_lua_setup_hook, dkimf_lua_screen_hook, dkimf_lua_stats_hook, dkimf_lua_final_hook): As above.

When luaL_setfuncs() is replaced by luaL_newlib() + lua_setglobal()
in commit 74b3374, the commit did
not take account that lua_setglobal() pops a value from the stack.

Thus, following lua pop(l, 1) tries to pop from empty stack in
Lua >= 5.2, especially in Lua 5.4, it causes abort().

This fix it.

* miltertest/miltertest.c (main):
  Don't pop after lua_setglobal() in Lua >= 5.2

* opendkim/opendkim-lua.c
  (dkimf_lua_setup_hook, dkimf_lua_screen_hook,
   dkimf_lua_stats_hook, dkimf_lua_final_hook): As above.
futatuki added a commit to futatuki/OpenDKIM that referenced this pull request Feb 27, 2024
futatuki added a commit to futatuki/OpenDKIM that referenced this pull request Apr 26, 2024
…tack

Lua: Fix starck level after registration of odkim functions.
futatuki added a commit to futatuki/OpenDKIM that referenced this pull request Apr 26, 2024
yasuhirokimura pushed a commit to yasuhirokimura/freebsd-ports that referenced this pull request Jun 20, 2024
PR:		279811
Reported by:	Yasuhito FUTATSUKI
Obtained from:	trusteddomainproject/OpenDKIM#201
yasuhirokimura pushed a commit to yasuhirokimura/freebsd-ports that referenced this pull request Jun 21, 2024
PR:		279811
Reported by:	Yasuhito FUTATSUKI
Obtained from:	trusteddomainproject/OpenDKIM#201
yasuhirokimura pushed a commit to yasuhirokimura/freebsd-ports that referenced this pull request Jun 21, 2024
PR:		279811
Reported by:	Yasuhito FUTATSUKI
Obtained from:	trusteddomainproject/OpenDKIM#201
yasuhirokimura pushed a commit to yasuhirokimura/freebsd-ports that referenced this pull request Jun 21, 2024
PR:		279811
Reported by:	Yasuhito FUTATSUKI
Obtained from:	trusteddomainproject/OpenDKIM#201
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Jun 21, 2024
PR:		279811
Reported by:	Yasuhito FUTATSUKI
Obtained from:	trusteddomainproject/OpenDKIM#201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant