summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2021-12-15 10:41:29 -0800
committerWouter van Oortmerssen <aardappel@gmail.com>2021-12-15 10:41:29 -0800
commitb8aaccee8248059b2af032cca0eb1d2ddbdb6cdc (patch)
tree55dfa0641f9eea26777f839f7c073de0290aca77 /include
parent2dc8ae77424afccaecb102174de712c04732d375 (diff)
downloadflatbuffers-b8aaccee8248059b2af032cca0eb1d2ddbdb6cdc.tar.gz
flatbuffers-b8aaccee8248059b2af032cca0eb1d2ddbdb6cdc.tar.bz2
flatbuffers-b8aaccee8248059b2af032cca0eb1d2ddbdb6cdc.zip
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.
Diffstat (limited to 'include')
-rw-r--r--include/flatbuffers/idl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h
index 208ac52c..a67d713f 100644
--- a/include/flatbuffers/idl.h
+++ b/include/flatbuffers/idl.h
@@ -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),