From 87390f53b0b9594ca42e41b08b328d354f7bf7c9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 19 Dec 2011 09:45:46 +0900 Subject: [PATCH] Z_Realloc() should zero-fill the expandded part of the mem Patch from Ozkan Sezer (sezero). Thank you. --- libs/util/zone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/util/zone.c b/libs/util/zone.c index 260a4c9a2..dc46017c8 100644 --- a/libs/util/zone.c +++ b/libs/util/zone.c @@ -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; }