summaryrefslogtreecommitdiff
path: root/ACE/ace/FILE_IO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/ace/FILE_IO.cpp')
-rw-r--r--ACE/ace/FILE_IO.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/ACE/ace/FILE_IO.cpp b/ACE/ace/FILE_IO.cpp
index 0013fb7fe0f..56afee6c968 100644
--- a/ACE/ace/FILE_IO.cpp
+++ b/ACE/ace/FILE_IO.cpp
@@ -124,16 +124,17 @@ ACE_FILE_IO::recvv (iovec *io_vec)
ACE_TRACE ("ACE_FILE_IO::recvv");
io_vec->iov_base = 0;
- size_t const length =
- static_cast <size_t> (ACE_OS::filesize (this->get_handle ()));
+ ACE_OFF_T const length = ACE_OS::filesize (this->get_handle ());
if (length > 0)
{
+ // Restrict to max size we can record in iov_len.
+ size_t len = ACE_Utils::truncate_cast<u_long> (length);
ACE_NEW_RETURN (io_vec->iov_base,
- char[length],
+ char[len],
-1);
- io_vec->iov_len = this->recv_n (io_vec->iov_base,
- length);
+ io_vec->iov_len = static_cast<u_long> (this->recv_n (io_vec->iov_base,
+ len));
return io_vec->iov_len;
}
else