mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
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>
This commit is contained in:
parent
e2ab9b71fa
commit
946cd7df28
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user