mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 22:11:04 +01:00
Guard VarData itemCount overflow (#5836)
Reject oversized merged VarData row sets before assigning them to the 16-bit itemCount field. This avoids truncating the serialized allocation size and prevents the subsequent row write loop from running out of bounds. src/hb-ot-layout-common.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Co-authored-by: Quang Luong <oss@engineer.ink>
This commit is contained in:
1 parent
283b568114
commit
91085cd990
1 file changed
+3
-1
@@ -2971,7 +2971,9 @@ struct VarData
|
||||
}
|
||||
|
||||
if (unlikely (!c->extend_min (this))) return_trace (false);
|
||||
itemCount = row_count;
|
||||
if (unlikely (!c->check_assign (itemCount, row_count,
|
||||
HB_SERIALIZE_ERROR_INT_OVERFLOW)))
|
||||
return_trace (false);
|
||||
|
||||
int min_threshold = has_long ? -65536 : -128;
|
||||
int max_threshold = has_long ? +65535 : +127;
|
||||
|
||||
Reference in new issue
Block a user