(svn r22875) -Codechange: Add some asserts and checks to better prevent overflow of the argument to malloc. (monoid)
This commit is contained in:
@@ -204,6 +204,8 @@ public:
|
||||
FORCEINLINE void Include(T *new_item)
|
||||
{
|
||||
if (this->IsFull()) {
|
||||
assert(this->capacity < UINT_MAX / 2);
|
||||
|
||||
this->capacity *= 2;
|
||||
this->data = ReallocT<T*>(this->data, this->capacity + 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user