summaryrefslogtreecommitdiff
path: root/system/lua5.3/CVE-2020-24370.patch
diff options
context:
space:
mode:
authorCyberLeo <cyberleo@cyberleo.net>2021-07-22 21:02:46 -0500
committerCyberLeo <cyberleo@cyberleo.net>2021-07-22 21:02:46 -0500
commit59068642667b2748b2f24d18c58b1d2fdfed7619 (patch)
treedeca4d721637676253ed1270f252f8d389286151 /system/lua5.3/CVE-2020-24370.patch
parent4a177049e3d486da3f54d346d63ea80699c08b5b (diff)
parent50e523c03bbcb6be1298e3dedb0441b7e47ab2eb (diff)
downloadpackages-59068642667b2748b2f24d18c58b1d2fdfed7619.tar.gz
packages-59068642667b2748b2f24d18c58b1d2fdfed7619.tar.bz2
packages-59068642667b2748b2f24d18c58b1d2fdfed7619.tar.xz
packages-59068642667b2748b2f24d18c58b1d2fdfed7619.zip
Merge branch 'master' into kpartx
Diffstat (limited to 'system/lua5.3/CVE-2020-24370.patch')
-rw-r--r--system/lua5.3/CVE-2020-24370.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/system/lua5.3/CVE-2020-24370.patch b/system/lua5.3/CVE-2020-24370.patch
new file mode 100644
index 000000000..0bfce24b1
--- /dev/null
+++ b/system/lua5.3/CVE-2020-24370.patch
@@ -0,0 +1,36 @@
+From b5bc89846721375fe30772eb8c5ab2786f362bf9 Mon Sep 17 00:00:00 2001
+From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
+Date: Mon, 3 Aug 2020 16:25:28 -0300
+Subject: [PATCH] Fixed bug: Negation overflow in getlocal/setlocal
+
+---
+ ldebug.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/ldebug.c b/ldebug.c
+index e1389296e..bb0e1d4ac 100644
+--- a/src/ldebug.c
++++ b/src/ldebug.c
+@@ -133,10 +133,11 @@ static const char *upvalname (Proto *p, int uv) {
+
+ static const char *findvararg (CallInfo *ci, int n, StkId *pos) {
+ int nparams = clLvalue(ci->func)->p->numparams;
+- if (n >= cast_int(ci->u.l.base - ci->func) - nparams)
++ int nvararg = cast_int(ci->u.l.base - ci->func) - nparams;
++ if (n <= -nvararg)
+ return NULL; /* no such vararg */
+ else {
+- *pos = ci->func + nparams + n;
++ *pos = ci->func + nparams - n;
+ return "(*vararg)"; /* generic name for any vararg */
+ }
+ }
+@@ -148,7 +149,7 @@ static const char *findlocal (lua_State *L, CallInfo *ci, int n,
+ StkId base;
+ if (isLua(ci)) {
+ if (n < 0) /* access to vararg values? */
+- return findvararg(ci, -n, pos);
++ return findvararg(ci, n, pos);
+ else {
+ base = ci->u.l.base;
+ name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci));