Reduce JSON depth limit to 128 (#477)

- also remove tpyo from net.mk
- STACK_FRAME_UNLIMITED is not needed
- also let parser allow 0e1, 0e+1 as floats
This commit is contained in:
Gautham 2022-07-11 22:53:44 +05:30 committed by GitHub
parent aeee2f9106
commit 11a1c62d11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View file

@ -27,7 +27,7 @@
#include "third_party/lua/ltests.h"
#include "third_party/lua/lua.h"
#define MAX_JSON_DEPTH 1024
#define MAX_JSON_DEPTH 128
struct Rc {
int t;
@ -99,7 +99,7 @@ static struct Rc Parse(struct lua_State *L, const char *p, const char *e) {
break;
case '0': // zero or number
if (p < e && *p == '.') {
if (p < e && (*p == '.' || *p == 'e' || *p == 'E')) {
goto UseDubble;
}
lua_pushinteger(L, 0);

View file

@ -210,9 +210,6 @@ o/$(MODE)/tool/net/demo/virtualbean.html.zip.o: \
-Predbean.justine.lol \
-B
o/$(MODE)/tool/net/ljson.o: \
-DSTACK_FRAME_UNLIMITED
o/$(MODE)/tool/net/redbean-demo.com.dbg: \
$(TOOL_NET_DEPS) \
o/$(MODE)/tool/net/redbean.o \