# HG changeset patch # User John Calcote # Date 1491589506 21600 # Fri Apr 07 12:25:06 2017 -0600 # Node ID 2faa881f0616fce98cf239e80989cd650347190d # Parent 51ed69107d096c5b9886954d89e0709975d5aa15 BUG#152: CVE-2016-4912 - fixed security vulnerability in xrealloc. diff --git a/openslp/common/slp_xmalloc.c b/openslp/common/slp_xmalloc.c --- a/openslp/common/slp_xmalloc.c +++ b/openslp/common/slp_xmalloc.c @@ -202,8 +202,8 @@ void * newptr = ptr; if (x->size != size) { - newptr = slp_xmalloc(file, line, size); - memcpy(newptr, ptr, x->size); + if ((newptr = slp_xmalloc(file, line, size)) != 0) + memcpy(newptr, ptr, x->size); slp_xfree(file, line, x); } return newptr;