]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Unsign some values related to allocation.
authorpfg <pfg@FreeBSD.org>
Mon, 22 Jan 2018 02:08:10 +0000 (02:08 +0000)
committerpfg <pfg@FreeBSD.org>
Mon, 22 Jan 2018 02:08:10 +0000 (02:08 +0000)
commitf0c6025eb618a80b6d1638a5600d7ed6950ffefa
treef469fa2de1347fb08ba66d2b41c9cab5eccfe14c
parent35335c1009e63e79b2a20cd64a4a142aba047ca6
Unsign some values related to allocation.

When allocating memory through malloc(9), we always expect the amount of
memory requested to be unsigned as a negative value would either stand for
an error or an overflow.
Unsign some values, found when considering the use of mallocarray(9), to
avoid unnecessary casting. Also consider that indexes should be of
at least the same size/type as the upper limit they pretend to index.

MFC after: 3 weeks
13 files changed:
sys/cam/scsi/scsi_ch.c
sys/dev/mps/mps.c
sys/fs/cd9660/cd9660_vnops.c
sys/fs/nandfs/nandfs_vfsops.c
sys/fs/nfsclient/nfs_clvnops.c
sys/kern/kern_exec.c
sys/kern/link_elf_obj.c
sys/kern/subr_hash.c
sys/kern/uipc_usrreq.c
sys/netpfil/ipfw/ip_fw_sockopt.c
sys/netpfil/ipfw/ip_fw_table_algo.c
sys/netsmb/smb_crypt.c
sys/x86/x86/mca.c