File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -960,6 +960,7 @@ static bool skipArrayScalars( const char * buf,
960960 {
961961 ret = false;
962962 }
963+
963964 break ;
964965 }
965966 }
@@ -1159,14 +1160,22 @@ static JSONStatus_t skipCollection( const char * buf,
11591160 {
11601161 depth -- ;
11611162
1162- if ( ( skipSpaceAndComma ( buf , & i , max ) == true ) &&
1163- isOpenBracket_ ( stack [ depth ] ) )
1163+ if ( skipSpaceAndComma ( buf , & i , max ) == true )
11641164 {
11651165 if ( skipScalars ( buf , & i , max , stack [ depth ] ) != true )
11661166 {
11671167 ret = JSONIllegalDocument ;
11681168 }
11691169 }
1170+ else
1171+ {
1172+ /* After closing a nested collection, if there is no comma found when calling
1173+ * skipSpaceAndComma, then we must be at the end of the parent collection. */
1174+ if ( ( i < max ) && !isMatchingBracket_ ( stack [ depth ], buf [ i ] ) )
1175+ {
1176+ ret = JSONIllegalDocument ;
1177+ }
1178+ }
11701179
11711180 break ;
11721181 }
You can’t perform that action at this time.
0 commit comments