1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Fix json parser (void objects not recognized) modified: json.cpp

This commit is contained in:
Olivier Bertrand
2020-12-18 18:59:52 +01:00
parent a786741000
commit 24c18ce892
2 changed files with 15 additions and 12 deletions

View File

@@ -554,7 +554,7 @@ PJAR JDOC::ParseArray(PGLOBAL g, int& i)
PJOB JDOC::ParseObject(PGLOBAL g, int& i)
{
PSZ key;
int level = 0;
int level = -1;
PJOB jobp = new(g) JOBJECT;
PJPR jpp = NULL;
@@ -590,7 +590,7 @@ PJOB JDOC::ParseObject(PGLOBAL g, int& i)
break;
case '}':
if (level < 2) {
if (level == 0 || level == 1) {
sprintf(g->Message, "Unexpected '}' near %.*s", ARGS);
throw 2;
} // endif level