mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-30 01:54:21 +01:00
Revert "[sanitize] Only check trailing edge of ranges"
This reverts commit e4856cf809.
This is wrong on at least 32-bit systems. Might add a condition
version later.
This commit is contained in:
1 parent
0b879afb5a
commit
73ee9c346f
1 file changed
+4
-2
+4
-2
@@ -268,7 +268,8 @@ struct hb_sanitize_context_t :
|
||||
unsigned int len) const
|
||||
{
|
||||
const char *p = (const char *) base;
|
||||
bool ok = (intptr_t) (this->end - p) >= (intptr_t) len &&
|
||||
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,
|
||||
@@ -287,7 +288,8 @@ struct hb_sanitize_context_t :
|
||||
unsigned int len) const
|
||||
{
|
||||
const char *p = (const char *) base;
|
||||
bool ok = (intptr_t) (this->end - p) >= (intptr_t) len;
|
||||
bool ok = ((uintptr_t) (p - this->start) <= this->length &&
|
||||
(unsigned int) (this->end - p) >= len);
|
||||
|
||||
DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0,
|
||||
"check_range_fast [%p..%p]"
|
||||
|
||||
Reference in new issue
Block a user