Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sandbox:master commit in: libsbutil/
Date: Sun, 20 Sep 2015 08:15:34
Message-Id: 1442730925.7e7a7a025dd2d43daf0b8ca14135e14bcaf871ce.vapier@gentoo
1 commit: 7e7a7a025dd2d43daf0b8ca14135e14bcaf871ce
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 20 06:35:25 2015 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 20 06:35:25 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=7e7a7a02
7
8 libsbutil: undef memory redirect calls
9
10 Sometimes the C library will redirect a call to strdup to __strdup which
11 breaks when we're using the libsandbox memory allocator. This was fixed
12 in libsandbox in commit d7801453aced46a6f31d8455877edeb31a5211cc, but we
13 didn't notice in libsbutil as no calls to strdup happened to come up.
14
15 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
16
17 libsbutil/sb_memory.c | 6 ++++++
18 1 file changed, 6 insertions(+)
19
20 diff --git a/libsbutil/sb_memory.c b/libsbutil/sb_memory.c
21 index bdc054f..ebc1c8e 100644
22 --- a/libsbutil/sb_memory.c
23 +++ b/libsbutil/sb_memory.c
24 @@ -11,6 +11,12 @@
25 #include "headers.h"
26 #include "sbutil.h"
27
28 +/* Make sure the C library doesn't rewrite calls to funcs libsandbox provides. */
29 +#undef calloc
30 +#undef malloc
31 +#undef realloc
32 +#undef strdup
33 +
34 void *
35 __xcalloc(size_t nmemb, size_t size, const char *file, const char *func, size_t line)
36 {