Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Aug 2016 09:32:20 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304556 - head/sys/compat/cloudabi64
Message-ID:  <201608210932.u7L9WKbs016267@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sun Aug 21 09:32:20 2016
New Revision: 304556
URL: https://svnweb.freebsd.org/changeset/base/304556

Log:
  Use the right _MAX constant.
  
  Though uio_resid is of type ssize_t, we need to take into account that
  this source file contains an implementation specific to a certain
  userspace pointer size. If this file provided 32-bit implementations,
  this should have used INT32_MAX, even when running a 64-bit kernel.
  
  This change has no effect, but is simply in preparation for adding
  support for running 32-bit CloudABI executables.

Modified:
  head/sys/compat/cloudabi64/cloudabi64_fd.c

Modified: head/sys/compat/cloudabi64/cloudabi64_fd.c
==============================================================================
--- head/sys/compat/cloudabi64/cloudabi64_fd.c	Sun Aug 21 07:41:11 2016	(r304555)
+++ head/sys/compat/cloudabi64/cloudabi64_fd.c	Sun Aug 21 09:32:20 2016	(r304556)
@@ -72,7 +72,7 @@ cloudabi64_copyinuio(const cloudabi64_io
 		}
 		iov[i].iov_base = (void *)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);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608210932.u7L9WKbs016267>