Added missing nullptr check in vector of union verifiers.
Change-Id: Iec720991e68ad27580537135bfd8eb4159333921 Tested: on Linux.
This commit is contained in:
parent
b24f2016a1
commit
0c86929e39
|
@ -548,6 +548,7 @@ inline bool VerifyEquipment(flatbuffers::Verifier &verifier, const void *obj, Eq
|
|||
}
|
||||
|
||||
inline bool VerifyEquipmentVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) {
|
||||
if (!values || !types) return !values && !types;
|
||||
if (values->size() != types->size()) return false;
|
||||
for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
|
||||
if (!VerifyEquipment(
|
||||
|
|
|
@ -1100,6 +1100,7 @@ class CppGenerator : public BaseGenerator {
|
|||
code_ += "";
|
||||
|
||||
code_ += "inline " + UnionVectorVerifySignature(enum_def) + " {";
|
||||
code_ += " if (!values || !types) return !values && !types;";
|
||||
code_ += " if (values->size() != types->size()) return false;";
|
||||
code_ += " for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {";
|
||||
code_ += " if (!Verify" + Name(enum_def) + "(";
|
||||
|
|
|
@ -1802,6 +1802,7 @@ inline bool VerifyAny(flatbuffers::Verifier &verifier, const void *obj, Any type
|
|||
}
|
||||
|
||||
inline bool VerifyAnyVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) {
|
||||
if (!values || !types) return !values && !types;
|
||||
if (values->size() != types->size()) return false;
|
||||
for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
|
||||
if (!VerifyAny(
|
||||
|
|
|
@ -455,6 +455,7 @@ inline bool VerifyCharacter(flatbuffers::Verifier &verifier, const void *obj, Ch
|
|||
}
|
||||
|
||||
inline bool VerifyCharacterVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) {
|
||||
if (!values || !types) return !values && !types;
|
||||
if (values->size() != types->size()) return false;
|
||||
for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
|
||||
if (!VerifyCharacter(
|
||||
|
|
Loading…
Reference in New Issue