freebsd-src/share
Kristof Provost 2506e2e267 MFC r327674, r327796
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
2018-01-23 04:37:31 +00:00
..
colldef MFC r290083: 2015-12-04 18:21:05 +00:00
dict Disconnect non-MPSAFE NTFS from the build in preparation for dropping 2012-10-17 11:30:00 +00:00
doc MFC r289393: 2015-12-04 18:14:31 +00:00
dtrace MFC 294548-294549,294556,294684: Add watch scripts 2016-01-27 05:04:17 +00:00
examples MFC r326140: vmrun.sh: add -A option for AHCI emulation of disk devices 2018-01-15 12:00:34 +00:00
i18n MFC r295234: 2016-02-07 16:51:50 +00:00
info Install the template info directory with mode 644 instead of 444 to 2013-01-21 22:54:43 +00:00
keys MFC r290083: 2015-12-04 18:21:05 +00:00
man MFC r327674, r327796 2018-01-23 04:37:31 +00:00
me
misc MFC r326633: 2017-12-08 10:50:13 +00:00
mk MFC r321952: 2017-09-30 20:46:34 +00:00
mklocale MFC r290083: 2015-12-04 18:21:05 +00:00
monetdef MFC r290083: 2015-12-04 18:21:05 +00:00
msgdef MFC r290083: 2015-12-04 18:21:05 +00:00
numericdef MFC r290083: 2015-12-04 18:21:05 +00:00
security
sendmail MFC r290083: 2015-12-04 18:21:05 +00:00
skel MFC r312721: skel: Remove reference to deleted part in previous commit 2017-02-05 15:46:05 +00:00
snmp
syscons MFC r289393: 2015-12-04 18:14:31 +00:00
tabset
termcap MFC r275687,r275692: 2015-01-11 18:13:56 +00:00
tests MFC r289172,r290254: 2017-02-09 22:49:48 +00:00
timedef MFC r290083: 2015-12-04 18:21:05 +00:00
vt MFC 321858: Add alternate Turkish keyboard layout F, submitted by Ufur Guler. 2017-08-08 10:45:22 +00:00
zoneinfo MFC r320702,r320703: 2017-08-05 16:55:07 +00:00
Makefile MFC r289393: 2015-12-04 18:14:31 +00:00
Makefile.inc