Fix possible but improbable overflow in hb_array_t
This commit is contained in:
parent
e0db4b868f
commit
123aa04f7b
|
@ -297,7 +297,7 @@ struct hb_static_array_t {
|
||||||
array = new_array;
|
array = new_array;
|
||||||
}
|
}
|
||||||
} else {
|
} 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))
|
if (unlikely (overflows))
|
||||||
new_array = NULL;
|
new_array = NULL;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue