(svn r22875) -Codechange: Add some asserts and checks to better prevent overflow of the argument to malloc. (monoid)

This commit is contained in:
michi_cc
2011-09-02 20:54:51 +00:00
parent 65637d8941
commit f227e90c24
6 changed files with 22 additions and 1 deletions

View File

@@ -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);
}