From 7d91f07edf29c4923716af6cee8eb94f948ac91f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 7 Nov 2018 09:14:42 -0500 Subject: [PATCH] [post] Protect against huge empty tables --- src/hb-ot-post-table.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-post-table.hh b/src/hb-ot-post-table.hh index 00bd1bcb9..b29096f16 100644 --- a/src/hb-ot-post-table.hh +++ b/src/hb-ot-post-table.hh @@ -128,7 +128,9 @@ struct post pool = &StructAfter (v2.glyphNameIndex); const uint8_t *end = (uint8_t *) table + table_length; - for (const uint8_t *data = pool; data < end && data + *data < end; data += 1 + *data) + for (const uint8_t *data = pool; + index_to_offset.len < 65535 && data < end && data + *data < end; + data += 1 + *data) index_to_offset.push (data - pool); } inline void fini (void)