svn commit: r328218 - in head/sys: amd64/amd64 arm/xscale/ixp425 arm64/arm64 cam cam/ctl compat/ndis dev/aacraid dev/advansys dev/ath dev/beri/virtio dev/bnxt dev/bwn dev/ciss dev/cxgbe/crypto dev/...

Konstantin Belousov kostikbel at gmail.com
Wed Jan 24 18:27:02 UTC 2018


On Wed, Jan 24, 2018 at 11:05:24AM -0700, Warner Losh wrote:
> Let's start with his point about u_long vs size_t causing problems:
> 
> void    *malloc(unsigned long size, struct malloc_type *type, int flags)
> vs
> void    *mallocarray(size_t nmemb, size_t size, struct malloc_type *type,
> 
> Since size_t is long long on i386, for example, this can result in
> undetected overflows. Such inattention to detail makes me extremely uneasy
> about the rest of the code.

size_t has same representation as u_long on all supported arches.
size_t is 32bit on i386, why could it need to be 64bit on 32bit architecture ?


More information about the svn-src-head mailing list