openslp: Fix CVE-2016-4912

This commit is contained in:
adisbladis
2018-01-07 04:25:12 +08:00
parent 45f6d97e6e
commit 1aca02b51e
2 changed files with 12 additions and 0 deletions
@@ -0,0 +1,11 @@
--- a/common/slp_xmalloc.c
+++ b/common/slp_xmalloc.c
@@ -206,7 +206,7 @@ void * _xrealloc(const char * file, int line, void * ptr, size_t size)
if (newptr == 0)
return 0;
memcpy(newptr, ptr, x->size);
- _xfree(file, line, x);
+ _xfree(file, line, ptr);
}
return newptr;
}