Disable parsing of nested_flatbuffers as bytes by default

Parsing as bytes produces buffers that are unsafe to access unless passed thru a verifier,
whereas users could reasonably assume that any JSON parsed without errors is safe to access.
Users that still have legacy JSON files with such bytes in it will get a helpful error point them
to the option to turn on to have it work again.
This commit is contained in:
Wouter van Oortmerssen
2021-12-15 10:41:29 -08:00
parent 2dc8ae7742
commit b8aaccee82
4 changed files with 17 additions and 1 deletions

View File

@@ -595,6 +595,7 @@ struct IDLOptions {
bool cs_global_alias;
bool json_nested_flatbuffers;
bool json_nested_flexbuffers;
bool json_nested_legacy_flatbuffers;
// Possible options for the more general generator below.
enum Language {
@@ -684,6 +685,7 @@ struct IDLOptions {
cs_global_alias(false),
json_nested_flatbuffers(true),
json_nested_flexbuffers(true),
json_nested_legacy_flatbuffers(false),
mini_reflect(IDLOptions::kNone),
require_explicit_ids(false),
lang_to_generate(0),