commit: 7e7a7a025dd2d43daf0b8ca14135e14bcaf871ce
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 20 06:35:25 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 06:35:25 2015 +0000
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=7e7a7a02
libsbutil: undef memory redirect calls
Sometimes the C library will redirect a call to strdup to __strdup which
breaks when we're using the libsandbox memory allocator. This was fixed
in libsandbox in commit d7801453aced46a6f31d8455877edeb31a5211cc, but we
didn't notice in libsbutil as no calls to strdup happened to come up.
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
libsbutil/sb_memory.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libsbutil/sb_memory.c b/libsbutil/sb_memory.c
index bdc054f..ebc1c8e 100644
--- a/libsbutil/sb_memory.c
+++ b/libsbutil/sb_memory.c
@@ -11,6 +11,12 @@
#include "headers.h"
#include "sbutil.h"
+/* Make sure the C library doesn't rewrite calls to funcs libsandbox provides.
*/
+#undef calloc
+#undef malloc
+#undef realloc
+#undef strdup
+
void *
__xcalloc(size_t nmemb, size_t size, const char *file, const char *func,
size_t line)
{