mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 19:08:58 +00:00
2506e2e267
Introduce mallocarray() in the kernel Similar to calloc() the mallocarray() function checks for integer overflows before allocating memory. It does not zero memory, unless the M_ZERO flag is set. Additionally, move the overflow check logic out to WOULD_OVERFLOW() for consumers to have a common means of testing for overflowing allocations. WOULD_OVERFLOW() should be a secondary check -- on 64-bit platforms, just because an allocation won't overflow size_t does not mean it is a sane size to request. Callers should be imposing reasonable allocation limits far, far, below overflow. Obtained from: OpenBSD |
||
---|---|---|
.. | ||
colldef | ||
dict | ||
doc | ||
dtrace | ||
examples | ||
i18n | ||
info | ||
keys | ||
man | ||
me | ||
misc | ||
mk | ||
mklocale | ||
monetdef | ||
msgdef | ||
numericdef | ||
security | ||
sendmail | ||
skel | ||
snmp | ||
syscons | ||
tabset | ||
termcap | ||
tests | ||
timedef | ||
vt | ||
zoneinfo | ||
Makefile | ||
Makefile.inc |