dvidelabs / flatcc

FlatBuffers Compiler and Library in C for C
Apache License 2.0
632 stars 180 forks source link

Fix end_loc in json parser context #186

Closed olivier-matz-6wind closed 3 years ago

olivier-matz-6wind commented 3 years ago

(Extracted from PR #185)

After parsing a table or struct, ctx->end_loc is set to the current value of buf, which is expected to be the end of the json data.

However the ctx->end_loc value is incorrect, because buf is not updated after the call to the parser callback function.

Fix this in both flatcc_json_parser_table_as_root() and flatcc_json_parser_struct_as_root().

mikkelfj commented 3 years ago

thanks