git: libc/nmalloc: Handle size_t overflows in posix_memalign().

Rimvydas Jasinskas zrj at crater.dragonflybsd.org
Mon Dec 18 08:25:38 PST 2017


commit e9586122ca8be1e743aa9cd2f9622dfe2f434ece
Author: zrj <rimvydas.jasinskas at gmail.com>
Date:   Sun Dec 17 17:54:01 2017 +0200

    libc/nmalloc: Handle size_t overflows in posix_memalign().
    
    Some algorithms/programs try to heuristically deduce alignment rules.
    Instead of confusing them with minimal allocations for size == (size_t)-7 and
    friends at different alignment values, just return ENOMEM since POSIX does not
    explictly specify how alignment overflows should behave. Programs should keep
    track of pointers they try to allocate (including size == 0 case too).

Summary of changes:
 lib/libc/stdlib/nmalloc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e9586122ca8be1e743aa9cd2f9622dfe2f434ece


-- 
DragonFly BSD source repository


More information about the Commits mailing list