Z_Realloc() should zero-fill the expandded part of the mem

Patch from Ozkan Sezer (sezero). Thank you.
This commit is contained in:
Bill Currie 2011-12-19 09:45:46 +09:00
parent 0238791b49
commit 87390f53b0

View file

@ -278,6 +278,8 @@ Z_Realloc (memzone_t *zone, void *ptr, int size)
if (ptr != old_ptr)
memmove (ptr, old_ptr, min (old_size, size));
if (old_size < size)
memset ((byte *)ptr + old_size, 0, size - old_size);
return ptr;
}