openslp-2.0.0-null-pointer-deref.patch 515 B

12345678910111213
  1. diff -up openslp-2.0.0/common/slp_xmalloc.c.orig openslp-2.0.0/common/slp_xmalloc.c
  2. --- openslp-2.0.0/common/slp_xmalloc.c.orig 2012-12-07 01:52:08.000000000 +0100
  3. +++ openslp-2.0.0/common/slp_xmalloc.c 2016-05-23 12:58:57.953532979 +0200
  4. @@ -203,6 +203,8 @@ void * _xrealloc(const char * file, int
  5. if (x->size != size)
  6. {
  7. newptr = _xmalloc(file, line, size);
  8. + if (newptr == 0)
  9. + return 0;
  10. memcpy(newptr, ptr, x->size);
  11. _xfree(file, line, x);
  12. }