summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2010-01-13 12:40:11 +0000
committerotto <otto@openbsd.org>2010-01-13 12:40:11 +0000
commit036d0e01978b166cdef6a458291d80ad71054cf3 (patch)
tree92c4fdd8561a48ae9b9a68031aa7db6f0f84eb57 /lib/libc/stdlib/malloc.c
parentDouble and in comment. (diff)
downloadwireguard-openbsd-036d0e01978b166cdef6a458291d80ad71054cf3.tar.xz
wireguard-openbsd-036d0e01978b166cdef6a458291d80ad71054cf3.zip
New options 'S', as a shorthand for the options most suitable as an
extra safeguard (FGJ). Idea from deraadt@; ok deraadt@ dlg@
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 9bdea862f2d..9cee3e5935f 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.123 2009/12/16 08:23:53 otto Exp $ */
+/* $OpenBSD: malloc.c,v 1.124 2010/01/13 12:40:11 otto Exp $ */
/*
* Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
*
@@ -661,6 +661,10 @@ omalloc_init(struct dir_info **dp)
case 'R':
mopts.malloc_realloc = 1;
break;
+ case 'S':
+ mopts.malloc_freeprot = mopts.malloc_junk = 1;
+ mopts.malloc_guard = MALLOC_PAGESIZE;
+ break;
case 'x':
mopts.malloc_xmalloc = 0;
break;