--- libelwix/src/mem.c 2015/07/01 21:48:39 1.6 +++ libelwix/src/mem.c 2016/05/14 13:12:43 1.6.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: mem.c,v 1.6 2015/07/01 21:48:39 misho Exp $ +* $Id: mem.c,v 1.6.2.2 2016/05/14 13:12:43 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2015 +Copyright 2004 - 2016 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -291,7 +291,7 @@ mpool_realloc(mpool_t * __restrict mp, void * __restri if (!p) return NULL; - memcpy(p, data, osize); + memcpy(p, data, MIN(osize, newsize)); mpool_free(mp, data, 0); } else { p = data;