BUG/MINOR: lua: unsafe initialization
During the Lua HAProxy initialisation, C functions using Lua calls can throws an error. This error was not catched. This patch fix this behaviour.
This commit is contained in:
parent
8feaa661b6
commit
75933d48fe
@ -6591,6 +6591,12 @@ void hlua_init(void)
|
|||||||
/* Initialise lua. */
|
/* Initialise lua. */
|
||||||
luaL_openlibs(gL.T);
|
luaL_openlibs(gL.T);
|
||||||
|
|
||||||
|
/* Set safe environment for the initialisation. */
|
||||||
|
if (!SET_SAFE_LJMP(gL.T)) {
|
||||||
|
fprintf(stderr, "Lua init: critical error.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Create "core" object.
|
* Create "core" object.
|
||||||
@ -7151,4 +7157,6 @@ void hlua_init(void)
|
|||||||
/* Initialize SSL server. */
|
/* Initialize SSL server. */
|
||||||
ssl_sock_prepare_srv_ctx(&socket_ssl, &socket_proxy);
|
ssl_sock_prepare_srv_ctx(&socket_ssl, &socket_proxy);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
RESET_SAFE_LJMP(gL.T);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user