From: Aurelien DARRAGON Date: Tue, 4 Jun 2024 08:52:44 +0000 (+0200) Subject: CLEANUP: hlua: get rid of hlua_traceback() security checks X-Git-Tag: v3.1-dev1~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2be94c008ee0955c04fa4f92bd487229d4383879;p=thirdparty%2Fhaproxy.git CLEANUP: hlua: get rid of hlua_traceback() security checks Thanks to the previous commit, we may now assume that hlua_traceback() won't LJMP, so it's safe to use it from unprotected environment without any precautions. --- diff --git a/src/hlua.c b/src/hlua.c index cd6619b3b7..227d3b60ca 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -9786,19 +9786,11 @@ static struct task *hlua_event_runner(struct task *task, void *context, unsigned event_hdl_pause(hlua_sub->sub); hlua_sub->paused = 1; - if (SET_SAFE_LJMP(hlua_sub->hlua)) { - /* The following Lua call may fail. */ - trace = hlua_traceback(hlua_sub->hlua->T, ", "); - /* At this point the execution is safe. */ - RESET_SAFE_LJMP(hlua_sub->hlua); - } else { - /* Lua error was raised while fetching lua trace from current ctx */ - SEND_ERR(NULL, "Lua event_hdl: unexpected error (memory failure?).\n"); - } + trace = hlua_traceback(hlua_sub->hlua->T, ", "); + ha_warning("Lua event_hdl: pausing the subscription because the handler fails " "to keep up the pace (%u unconsumed events) from %s.\n", - event_hdl_async_equeue_size(&hlua_sub->equeue), - (trace) ? trace : "[unknown]"); + event_hdl_async_equeue_size(&hlua_sub->equeue), trace); } if (HLUA_IS_RUNNING(hlua_sub->hlua)) {