diff options
| author | nikita <nikita@NetBSD.org> | 2023-04-17 21:17:57 +0000 |
|---|---|---|
| committer | nikita <nikita@NetBSD.org> | 2023-04-17 21:17:57 +0000 |
| commit | ec0fc2537c3b236d3445dab271d9b967959ab4b5 (patch) | |
| tree | a6d08046b29f2daca55f5cf19a9326d9fb752d17 /external/mit/lua/dist/src/lundump.c | |
| parent | 8a34e137b90fcb2b3cc411075d0aa5937b4173e0 (diff) | |
lua: apply upstream bugfix for "Loading a corrupted binary file can segfault."
Diffstat (limited to 'external/mit/lua/dist/src/lundump.c')
| -rw-r--r-- | external/mit/lua/dist/src/lundump.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/external/mit/lua/dist/src/lundump.c b/external/mit/lua/dist/src/lundump.c index 1ceb2106674..6e4533c7375 100644 --- a/external/mit/lua/dist/src/lundump.c +++ b/external/mit/lua/dist/src/lundump.c @@ -1,4 +1,4 @@ -/* $NetBSD: lundump.c,v 1.9 2023/04/16 20:46:17 nikita Exp $ */ +/* $NetBSD: lundump.c,v 1.10 2023/04/17 21:17:57 nikita Exp $ */ /* ** Id: lundump.c @@ -254,6 +254,8 @@ static void loadDebug (LoadState *S, Proto *f) { f->locvars[i].endpc = loadInt(S); } n = loadInt(S); + if (n != 0) /* does it have debug information? */ + n = f->sizeupvalues; /* must be this many */ for (i = 0; i < n; i++) f->upvalues[i].name = loadStringN(S, f); } |
