summaryrefslogtreecommitdiff
path: root/storage/connect/json.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2020-12-18 18:59:52 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2020-12-18 18:59:52 +0100
commit24c18ce8926105d77ebff2d63611af440aaa8bee (patch)
treec79884d2b7e9db78e7a6db39ddd17c706e920545 /storage/connect/json.cpp
parenta7867410009ce91e3e710ace0b0d97261170d44a (diff)
downloadmariadb-git-24c18ce8926105d77ebff2d63611af440aaa8bee.tar.gz
- Fix json parser (void objects not recognized) modified: json.cpp
Diffstat (limited to 'storage/connect/json.cpp')
-rw-r--r--storage/connect/json.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/connect/json.cpp b/storage/connect/json.cpp
index 7c1748e0fde..bcbd71b5031 100644
--- a/storage/connect/json.cpp
+++ b/storage/connect/json.cpp
@@ -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