diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2017-04-18 15:46:45 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2017-04-18 15:46:45 +0000 |
commit | d594621d1e17808877ec4349feef66230a5830e0 (patch) | |
tree | da8848652bee14f41339a2b9a0a780c5b6d590e8 /lib/libc/stdlib | |
parent | cd7822d800a6792f32cf2c8d7b0afd6f066595e3 (diff) |
don't forget to fill in canary bytes for posix_memalign(3); reported by
and ok jeremy@
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 5b92b56eb48..4e5176f71ee 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.222 2017/04/17 16:36:35 otto Exp $ */ +/* $OpenBSD: malloc.c,v 1.223 2017/04/18 15:46:44 otto Exp $ */ /* * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> @@ -2018,6 +2018,9 @@ omemalign(struct dir_info *pool, size_t alignment, size_t sz, int zero_fill, voi else memset(p, SOME_JUNK, psz - mopts.malloc_guard); } + else if (mopts.chunk_canaries) + fill_canary(p, sz - mopts.malloc_guard, + psz - mopts.malloc_guard); return p; } |