mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue