about summary refs log tree commit diff
path: root/pkgs/development/interpreters/lua-5
diff options
context:
space:
mode:
authorBenjamin Hipple <bhipple@protonmail.com>2018-05-19 11:30:04 -0400
committerxeji <36407913+xeji@users.noreply.github.com>2018-05-19 17:30:04 +0200
commit17f50018c0ca87e196882c0ba4aee68703e3fcf0 (patch)
treee6242554335c6365cf119f4c4f110686aa3bb5cd /pkgs/development/interpreters/lua-5
parent28c1c0ab26b2b18f838b5275146210938b0b1643 (diff)
downloadnixlib-17f50018c0ca87e196882c0ba4aee68703e3fcf0.tar
nixlib-17f50018c0ca87e196882c0ba4aee68703e3fcf0.tar.gz
nixlib-17f50018c0ca87e196882c0ba4aee68703e3fcf0.tar.bz2
nixlib-17f50018c0ca87e196882c0ba4aee68703e3fcf0.tar.lz
nixlib-17f50018c0ca87e196882c0ba4aee68703e3fcf0.tar.xz
nixlib-17f50018c0ca87e196882c0ba4aee68703e3fcf0.tar.zst
nixlib-17f50018c0ca87e196882c0ba4aee68703e3fcf0.zip
lua5.1: fix broken source fetch (#40748)
The upstream src URL for the patch appears to no longer exist. Per discussion in
https://github.com/NixOS/nixpkgs/issues/39927, the upstream URL is not stable,
so this commit inlines the patch in the nixpkgs src tree.
Diffstat (limited to 'pkgs/development/interpreters/lua-5')
-rw-r--r--pkgs/development/interpreters/lua-5/5.1.0004-Fix-stack-overflow-in-vararg-functions.patch21
-rw-r--r--pkgs/development/interpreters/lua-5/5.1.nix7
2 files changed, 22 insertions, 6 deletions
diff --git a/pkgs/development/interpreters/lua-5/5.1.0004-Fix-stack-overflow-in-vararg-functions.patch b/pkgs/development/interpreters/lua-5/5.1.0004-Fix-stack-overflow-in-vararg-functions.patch
new file mode 100644
index 000000000000..31d3b8bdee76
--- /dev/null
+++ b/pkgs/development/interpreters/lua-5/5.1.0004-Fix-stack-overflow-in-vararg-functions.patch
@@ -0,0 +1,21 @@
+From: Enrico Tassi <gareuselesinge@debian.org>
+Date: Tue, 26 Aug 2014 16:20:55 +0200
+Subject: Fix stack overflow in vararg functions
+
+---
+ src/ldo.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ldo.c b/src/ldo.c
+index d1bf786..30333bf 100644
+--- a/src/ldo.c
++++ b/src/ldo.c
+@@ -274,7 +274,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
+     CallInfo *ci;
+     StkId st, base;
+     Proto *p = cl->p;
+-    luaD_checkstack(L, p->maxstacksize);
++    luaD_checkstack(L, p->maxstacksize + p->numparams);
+     func = restorestack(L, funcr);
+     if (!p->is_vararg) {  /* no varargs? */
+       base = func + 1;
diff --git a/pkgs/development/interpreters/lua-5/5.1.nix b/pkgs/development/interpreters/lua-5/5.1.nix
index 1c4fcd2811d1..15077578f27f 100644
--- a/pkgs/development/interpreters/lua-5/5.1.nix
+++ b/pkgs/development/interpreters/lua-5/5.1.nix
@@ -20,12 +20,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ readline ];
 
   patches = (if stdenv.isDarwin then [ ./5.1.darwin.patch ] else [ dsoPatch ])
-    ++ [(fetchpatch {
-      name = "CVE-2014-5461.patch";
-      url = "http://anonscm.debian.org/cgit/pkg-lua/lua5.1.git/plain/debian/patches/"
-        + "0004-Fix-stack-overflow-in-vararg-functions.patch?id=b75a2014db2ad65683521f7bb295bfa37b48b389";
-      sha256 = "05i5vh53d9i6dy11ibg9i9qpwz5hdm0s8bkx1d9cfcvy80cm4c7f";
-    })];
+    ++ [ ./5.1.0004-Fix-stack-overflow-in-vararg-functions.patch ];
 
   configurePhase =
     if stdenv.isDarwin