[sanitize] Minor tweak to len=0 case which is handled otherwise anyway

pull/4313/head
Behdad Esfahbod 2 years ago
parent 403bc7caa4
commit c24ea1036b
  1. 4
      src/hb-sanitize.hh

@ -269,7 +269,7 @@ struct hb_sanitize_context_t :
{
const char *p = (const char *) base;
bool ok = !len ||
((uintptr_t) (p - this->start) < this->length &&
((uintptr_t) (p - this->start) <= this->length &&
(unsigned int) (this->end - p) >= len &&
((this->max_ops -= len) > 0));
@ -289,7 +289,7 @@ struct hb_sanitize_context_t :
unsigned int len) const
{
const char *p = (const char *) base;
bool ok = ((uintptr_t) (p - this->start) < this->length &&
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,

Loading…
Cancel
Save