avoid overflow in poll() timeout calculation

Closes PR 14410

Merge to v6.0.1
(cherry picked from commit 393456563e)
This commit is contained in:
Matthew Flatt 2014-04-13 19:08:19 -06:00 committed by Ryan Culpepper
parent a130b66588
commit 030206f39f

View File

@ -10667,6 +10667,8 @@ static void default_sleep(float v, void *fds)
if (v <= 0.0)
timeout = -1;
else if (v > 100000)
timeout = 100000000;
else {
timeout = (int)(v * 1000.0);
if (timeout < 0)