From 480406cd3ef9e5ab8476ddfa04498bf23906c508 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 14 Jan 2019 15:27:34 -0500 Subject: [PATCH] Fix assertion on address overflow Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=917031 --- src/hb-machinery.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index fdb7b0a0d..07511e146 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -269,9 +269,10 @@ struct hb_sanitize_context_t : const char *obj_start = (const char *) obj; const char *obj_end = (const char *) obj + obj->get_size (); - assert (obj_start <= obj_end); /* Must not overflow. */ - if (unlikely (obj_end < this->start || this->end < obj_start)) + if (unlikely (obj_end < obj_start /* Overflow. */ || + obj_end < this->start || + this->end < obj_start)) this->start = this->end = nullptr; else {