Modify OffsetTo<>::sanitize() overflow check
The code in question was introduced in 70eb2ff682
.
Rewrite it to not call sanitizer check_range() as we want to use
check_range() for byte accounting.
Part of https://github.com/harfbuzz/harfbuzz/pull/2923
This commit is contained in:
parent
4dba749d83
commit
70110f6aaa
|
@ -387,7 +387,7 @@ struct OffsetTo : Offset<OffsetType, has_null>
|
|||
TRACE_SANITIZE (this);
|
||||
if (unlikely (!c->check_struct (this))) return_trace (false);
|
||||
if (unlikely (this->is_null ())) return_trace (true);
|
||||
if (unlikely (!c->check_range (base, *this))) return_trace (false);
|
||||
if (unlikely ((const char *) base + (unsigned) *this < (const char *) base)) return_trace (false);
|
||||
return_trace (true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue