Hi all,

This is a first patch for the lua module already overviewed by Thierry
Fournier.
This one concerns a bug fix which was spotted by calling a convertor (made
in C) from within Lua module.

Hope it finds its way.

Kindest regards.
From e2a6138fae6334c4275ba786e58ccd02a7e45c73 Mon Sep 17 00:00:00 2001
From: David Carlier <devne...@gmail.com>
Date: Wed, 27 Apr 2016 16:14:50 +0100
Subject: [PATCH 1/2] BUG/MEDIUM: lua: protects the upper boundary of the
 argument list for converters/fetches.

When a converter or sample is called from within a Lua code, there is a risk
of invalid argument string data usage when the upper boundary is reached.
Would be kind to port to 1.6 if possible.
---
 src/hlua.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/hlua.c b/src/hlua.c
index 4132ace..221a781 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2954,6 +2954,7 @@ __LJMP static int hlua_run_sample_fetch(lua_State *L)
 		hlua_lua2arg(L, i + 2, &args[i]);
 	}
 	args[i].type = ARGT_STOP;
+	args[i].data.str.str = NULL;
 
 	/* Check arguments. */
 	MAY_LJMP(hlua_lua2arg_check(L, 2, args, f->arg_mask, hsmp->p));
@@ -3059,6 +3060,7 @@ __LJMP static int hlua_run_sample_conv(lua_State *L)
 		hlua_lua2arg(L, i + 3, &args[i]);
 	}
 	args[i].type = ARGT_STOP;
+	args[i].data.str.str = NULL;
 
 	/* Check arguments. */
 	MAY_LJMP(hlua_lua2arg_check(L, 3, args, conv->arg_mask, hsmp->p));
-- 
2.5.0

Reply via email to