diff options
author | Renato Botelho <renato@netgate.com> | 2016-10-12 11:41:26 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-10-12 11:41:26 -0300 |
commit | cb642130dfc50717bb970a104c44aa7690930a38 (patch) | |
tree | c67f108534217a209198c6b201949ecc73acaba3 /sys/compat/cloudabi64/cloudabi64_fd.c | |
parent | 5dd7ab172435dc99e1abc1f7d73fd5e720050bbc (diff) | |
parent | cd04fbc5e631c6b3e80a14eb7044c3be35fba2d2 (diff) | |
download | FreeBSD-src-cb642130dfc50717bb970a104c44aa7690930a38.zip FreeBSD-src-cb642130dfc50717bb970a104c44aa7690930a38.tar.gz |
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'sys/compat/cloudabi64/cloudabi64_fd.c')
-rw-r--r-- | sys/compat/cloudabi64/cloudabi64_fd.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/compat/cloudabi64/cloudabi64_fd.c b/sys/compat/cloudabi64/cloudabi64_fd.c index 7d0c69a..fcfcc42 100644 --- a/sys/compat/cloudabi64/cloudabi64_fd.c +++ b/sys/compat/cloudabi64/cloudabi64_fd.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include <contrib/cloudabi/cloudabi64_types.h> #include <compat/cloudabi64/cloudabi64_proto.h> +#include <compat/cloudabi64/cloudabi64_util.h> /* Copies in 64-bit iovec structures from userspace. */ static int @@ -70,9 +71,9 @@ cloudabi64_copyinuio(const cloudabi64_iovec_t *iovp, size_t iovcnt, free(uio, M_IOV); return (error); } - iov[i].iov_base = (void *)iovobj.iov_base; + iov[i].iov_base = TO_PTR(iovobj.iov_base); iov[i].iov_len = iovobj.iov_len; - if (iov[i].iov_len > SSIZE_MAX - uio->uio_resid) { + if (iov[i].iov_len > INT64_MAX - uio->uio_resid) { free(uio, M_IOV); return (EINVAL); } @@ -105,8 +106,7 @@ cloudabi64_sys_fd_pwrite(struct thread *td, struct uio *uio; int error; - error = cloudabi64_copyinuio((const cloudabi64_iovec_t *)uap->iov, - uap->iovcnt, &uio); + error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); if (error != 0) return (error); error = kern_pwritev(td, uap->fd, uio, uap->offset); @@ -136,8 +136,7 @@ cloudabi64_sys_fd_write(struct thread *td, struct uio *uio; int error; - error = cloudabi64_copyinuio((const cloudabi64_iovec_t *)uap->iov, - uap->iovcnt, &uio); + error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); if (error != 0) return (error); error = kern_writev(td, uap->fd, uio); |