mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 07:29:23 +00:00
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:
parent
aeee2f9106
commit
11a1c62d11
2 changed files with 2 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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 \
|
||||
|
|
Loading…
Add table
Reference in a new issue