summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/rc.sysinit6
-rw-r--r--sysconfig/mcheck9
2 files changed, 15 insertions, 0 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 432ad434..ba61fc6e 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -798,3 +798,9 @@ fi
wait
[ "$PROMPT" != no ] && rm -f /var/run/getkey_done
+if [ -f /etc/sysconfig/mcheck ]; then
+ . /etc/sysconfig/mcheck
+ if [ -n "$MALLOC_CHECK_" ]; then
+ export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
+ fi
+fi
diff --git a/sysconfig/mcheck b/sysconfig/mcheck
new file mode 100644
index 00000000..94f35bd7
--- /dev/null
+++ b/sysconfig/mcheck
@@ -0,0 +1,9 @@
+
+# MALLOC_CHECK_: should the system (libc) malloc check for memory errors?
+# Used values are:
+# unset: do not check
+# 0: silently ignore errors
+# 1: print diagnostics on stderr when an error is detected
+# 2: call abort when an error is detected
+export MALLOC_CHECK_=1
+