提交 123aa04f 编写于 作者: B Behdad Esfahbod

Fix possible but improbable overflow in hb_array_t

上级 e0db4b86
......@@ -297,7 +297,7 @@ struct hb_static_array_t {
array = new_array;
}
} else {
bool overflows = new_allocated >= ((unsigned int) -1) / sizeof (Type);
bool overflows = (new_allocated < allocated) || (new_allocated >= ((unsigned int) -1) / sizeof (Type));
if (unlikely (overflows))
new_array = NULL;
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册