[newlib-cygwin] check_iovec: Change test to be more robust against invalid iovcnt values
Corinna Vinschen
corinna@sourceware.org
Thu Jan 19 20:13:00 GMT 2017
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=946cd7df284175e5c36140349a4173ac64a76115
commit 946cd7df284175e5c36140349a4173ac64a76115
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Thu Jan 19 21:11:22 2017 +0100
check_iovec: Change test to be more robust against invalid iovcnt values
Stop running wild if iovcnt is < 0 to begin with.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/miscfuncs.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index e042d00..63e60f0 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -60,7 +60,7 @@ check_iovec (const struct iovec *iov, int iovcnt, bool forwrite)
size_t tot = 0;
- while (iovcnt != 0)
+ while (iovcnt > 0)
{
if (iov->iov_len > SSIZE_MAX || (tot += iov->iov_len) > SSIZE_MAX)
{
More information about the Cygwin-cvs
mailing list