mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 12:28:06 +00:00
Avoid intentional unsigned integer overflow getting caught by sanitizers (#5572)
* Avoid intentional unsigned integer overflow getting caught by sanitizers * Adapt from suggested compiler compatible solution * And a third way :)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
e9d29c21a7
commit
fbc11e8aec
@@ -2230,6 +2230,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__supress_ubsan__("unsigned-integer-overflow")
|
||||||
bool VerifyTableStart(const uint8_t *table) {
|
bool VerifyTableStart(const uint8_t *table) {
|
||||||
// Check the vtable offset.
|
// Check the vtable offset.
|
||||||
auto tableo = static_cast<size_t>(table - buf_);
|
auto tableo = static_cast<size_t>(table - buf_);
|
||||||
|
|||||||
Reference in New Issue
Block a user