0002-BUG-MINOR-lua-In-error-case-the-safe-mode-is-not-rem.patch 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From bcc483a9edfeb8ab69d1af83886d9e1323cffd06 Mon Sep 17 00:00:00 2001
  2. From: Thierry FOURNIER <thierry.fournier@ozon.io>
  3. Date: Wed, 12 Jul 2017 11:18:00 +0200
  4. Subject: [PATCH 02/18] BUG/MINOR: lua: In error case, the safe mode is not
  5. removed
  6. Just forgot of reset the safe mode. This have not consequences
  7. the safe mode just set a pointer on fucntion which is called only
  8. and initialises a longjmp.
  9. Out of lua execution, this longjmp is never executed and the
  10. function is never called.
  11. This patch should be backported in 1.6 and 1.7
  12. (cherry picked from commit 0a97620c080232a21ad7fce2c859a2edc9d7147e)
  13. Signed-off-by: Willy Tarreau <w@1wt.eu>
  14. ---
  15. src/hlua.c | 1 +
  16. 1 file changed, 1 insertion(+)
  17. diff --git a/src/hlua.c b/src/hlua.c
  18. index c862102d..4c1c2d21 100644
  19. --- a/src/hlua.c
  20. +++ b/src/hlua.c
  21. @@ -854,6 +854,7 @@ int hlua_ctx_init(struct hlua *lua, struct task *task)
  22. lua->T = lua_newthread(gL.T);
  23. if (!lua->T) {
  24. lua->Tref = LUA_REFNIL;
  25. + RESET_SAFE_LJMP(gL.T);
  26. return 0;
  27. }
  28. hlua_sethlua(lua);
  29. --
  30. 2.13.0