summaryrefslogtreecommitdiff
path: root/atomicio.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2016-12-20 00:22:52 +0000
committerColin Watson <cjwatson@debian.org>2016-12-20 00:22:52 +0000
commit971a7653746a6972b907dfe0ce139c06e4a6f482 (patch)
tree70fb964265d57ae4967be55b75dbb2a122e9b969 /atomicio.c
parenta8ed8d256b2e2c05b0c15565a7938028c5192277 (diff)
parent4a354fc231174901f2629437c2a6e924a2dd6772 (diff)
Import openssh_7.4p1.orig.tar.gz
Diffstat (limited to 'atomicio.c')
-rw-r--r--atomicio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/atomicio.c b/atomicio.c
index b1ec234f5..f854a06f5 100644
--- a/atomicio.c
+++ b/atomicio.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: atomicio.c,v 1.27 2015/01/16 06:40:12 deraadt Exp $ */ 1/* $OpenBSD: atomicio.c,v 1.28 2016/07/27 23:18:12 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2006 Damien Miller. All rights reserved. 3 * Copyright (c) 2006 Damien Miller. All rights reserved.
4 * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved. 4 * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved.
@@ -107,12 +107,12 @@ atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd,
107 struct iovec iov_array[IOV_MAX], *iov = iov_array; 107 struct iovec iov_array[IOV_MAX], *iov = iov_array;
108 struct pollfd pfd; 108 struct pollfd pfd;
109 109
110 if (iovcnt > IOV_MAX) { 110 if (iovcnt < 0 || iovcnt > IOV_MAX) {
111 errno = EINVAL; 111 errno = EINVAL;
112 return 0; 112 return 0;
113 } 113 }
114 /* Make a copy of the iov array because we may modify it below */ 114 /* Make a copy of the iov array because we may modify it below */
115 memcpy(iov, _iov, iovcnt * sizeof(*_iov)); 115 memcpy(iov, _iov, (size_t)iovcnt * sizeof(*_iov));
116 116
117#ifndef BROKEN_READV_COMPARISON 117#ifndef BROKEN_READV_COMPARISON
118 pfd.fd = fd; 118 pfd.fd = fd;