MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / VerifyTableStart

Function VerifyTableStart

native/thirdpart/flatbuffers/flatbuffers.h:2395–2407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2393 }
2394
2395 __supress_ubsan__("unsigned-integer-overflow") bool VerifyTableStart(
2396 const uint8_t *table) {
2397 // Check the vtable offset.
2398 auto tableo = static_cast<size_t>(table - buf_);
2399 if (!Verify<soffset_t>(tableo)) return false;
2400 // This offset may be signed, but doing the subtraction unsigned always
2401 // gives the result we want.
2402 auto vtableo = tableo - static_cast<size_t>(ReadScalar<soffset_t>(table));
2403 // Check the vtable size field, then check vtable fits in its entirety.
2404 return VerifyComplexity() && Verify<voffset_t>(vtableo) &&
2405 VerifyAlignment<voffset_t>(ReadScalar<voffset_t>(buf_ + vtableo)) &&
2406 Verify(vtableo, ReadScalar<voffset_t>(buf_ + vtableo));
2407 }
2408
2409 template<typename T>
2410 bool VerifyBufferFromStart(const char *identifier, size_t start) {

Callers 2

VerifyFunction · 0.85
VerifyFunction · 0.85

Calls 2

VerifyComplexityFunction · 0.85
VerifyFunction · 0.70

Tested by

no test coverage detected