Import 'reallocarray' from OpenBSD.
authorDan Cross <crossd@gmail.com>
Tue, 24 Nov 2015 02:57:01 +0000 (21:57 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 24 Nov 2015 20:10:05 +0000 (15:10 -0500)
commitfafa68356f1182fc8a9689be66ee6eef2006c54b
tree685e755cca75963a314c1a4fc43904fdfbedaa36
parent2a8a96f534b98decdc37bce1606d99269fbcf5dd
Import 'reallocarray' from OpenBSD.

Add this new function: a safe version of 'realloc' that avoids
integer overflow when computing the new size of the thing to
allocate.

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/kmalloc.h
kern/src/Kbuild
kern/src/kreallocarray.c [new file with mode: 0644]