Files
ports/security/samhain/files/patch-src_dnmalloc.c
T
Brooks Davis 4bfc940087 security/samhain: don't use sbrk
Samhain has an internal malloc implementation that uses sbrk and malloc.
There's a fallback during initialization if sbrk fails so replace sbrk
calls with a function that return the failure value ((void *)-1).

PR:		275646
Approved by:	freebsd@gregv.net (maintainer)
2025-02-18 20:59:20 +00:00

22 lines
328 B
C

--- src/dnmalloc.c.orig
+++ src/dnmalloc.c
@@ -660,8 +660,18 @@
sample version for pre-OSX macos.
*/
+#ifdef __FreeBSD__
+static void *nosbrk(ptrdiff_t len __unused) {
+ return MORECORE_FAILURE;
+}
+#endif
+
#ifndef MORECORE
+#ifdef __FreeBSD__
+#define MORECORE nosbrk
+#else
#define MORECORE sbrk
+#endif
#endif