mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-30 18:13:53 +01:00
[sanitize] Enlighten check_range() some more
No need to check for len=0 arrays. They must still be in range.
This commit is contained in:
1 parent
c24ea1036b
commit
6a683ea6eb
2 files changed
+5
-5
No files matched your search
@@ -258,7 +258,8 @@ struct fvar
|
||||
axisSize == 20 && /* Assumed in our code. */
|
||||
instanceSize >= axisCount * 4 + 4 &&
|
||||
get_axes ().sanitize (c) &&
|
||||
c->check_range (get_instance (0), instanceCount, instanceSize));
|
||||
c->check_range (&StructAfter<InstanceRecord> (get_axes ()),
|
||||
instanceCount, instanceSize));
|
||||
}
|
||||
|
||||
unsigned int get_axis_count () const { return axisCount; }
|
||||
|
||||
+3
-4
@@ -268,10 +268,9 @@ struct hb_sanitize_context_t :
|
||||
unsigned int len) const
|
||||
{
|
||||
const char *p = (const char *) base;
|
||||
bool ok = !len ||
|
||||
((uintptr_t) (p - this->start) <= this->length &&
|
||||
(unsigned int) (this->end - p) >= len &&
|
||||
((this->max_ops -= len) > 0));
|
||||
bool ok = (uintptr_t) (p - this->start) <= this->length &&
|
||||
(unsigned int) (this->end - p) >= len &&
|
||||
((this->max_ops -= len) > 0);
|
||||
|
||||
DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0,
|
||||
"check_range [%p..%p]"
|
||||
|
||||
Reference in new issue
Block a user