diff options
author | 2020-11-23 15:42:11 +0000 | |
---|---|---|
committer | 2020-11-23 15:42:11 +0000 | |
commit | 3e142b5f5cb35c8cab23ac0d23ae9bf7223127a6 (patch) | |
tree | 1819dbcf152097344d7e7450f442d635cd48eb7f /lib/libc/stdlib/malloc.c | |
parent | The -exec primary is terminated by either ';' or '+', but the latter (diff) | |
download | wireguard-openbsd-3e142b5f5cb35c8cab23ac0d23ae9bf7223127a6.tar.xz wireguard-openbsd-3e142b5f5cb35c8cab23ac0d23ae9bf7223127a6.zip |
mapalign() only handles allocations >= a page; problem found by and ok semarie@
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 86670fca876..7004a0aa368 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.266 2020/10/12 22:08:33 deraadt Exp $ */ +/* $OpenBSD: malloc.c,v 1.267 2020/11/23 15:42:11 otto Exp $ */ /* * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> @@ -1957,6 +1957,8 @@ omemalign(struct dir_info *pool, size_t alignment, size_t sz, int zero_fill, return NULL; } + if (sz < MALLOC_PAGESIZE) + sz = MALLOC_PAGESIZE; sz += mopts.malloc_guard; psz = PAGEROUND(sz); |