acpid: update to 2.0.28
[feed/packages.git] / net / haproxy / patches / 0005-BUG-MEDIUM-lua-bad-memory-access.patch
1 From ea3b479be6cacb399a6541a00b1bdce17b0179d0 Mon Sep 17 00:00:00 2001
2 From: Thierry FOURNIER <thierry.fournier@ozon.io>
3 Date: Mon, 17 Jul 2017 00:44:40 +0200
4 Subject: [PATCH 05/18] BUG/MEDIUM: lua: bad memory access
5
6 We cannot perform garbage collection on unreferenced thread.
7 This memory is now free and another Lua process can use it for
8 other things.
9
10 HAProxy is monothread, so this bug doesn't cause crash.
11
12 This patch must be backported in 1.6 and 1.7
13 (cherry picked from commit 7bd10d58d3aecf7cf1e5ee7df01193e07128a52d)
14
15 Signed-off-by: Willy Tarreau <w@1wt.eu>
16 ---
17 src/hlua.c | 12 +++---------
18 1 file changed, 3 insertions(+), 9 deletions(-)
19
20 diff --git a/src/hlua.c b/src/hlua.c
21 index eb003558..a998860e 100644
22 --- a/src/hlua.c
23 +++ b/src/hlua.c
24 @@ -895,16 +895,10 @@ void hlua_ctx_destroy(struct hlua *lua)
25 * the garbage collection.
26 */
27 if (lua->flags & HLUA_MUST_GC) {
28 - if (!SET_SAFE_LJMP(lua->T))
29 + if (!SET_SAFE_LJMP(gL.T))
30 return;
31 - lua_gc(lua->T, LUA_GCCOLLECT, 0);
32 - RESET_SAFE_LJMP(lua->T);
33 - if (lua_status(lua->T) != LUA_OK) {
34 - if (!SET_SAFE_LJMP(gL.T))
35 - return;
36 - lua_gc(gL.T, LUA_GCCOLLECT, 0);
37 - RESET_SAFE_LJMP(gL.T);
38 - }
39 + lua_gc(gL.T, LUA_GCCOLLECT, 0);
40 + RESET_SAFE_LJMP(gL.T);
41 }
42
43 lua->T = NULL;
44 --
45 2.13.0
46