fix COV 164298: integer overflow on multiplying timeout

This commit is contained in:
Christian Grothoff
2017-03-10 16:37:57 +01:00
parent 046ca77762
commit 2123decd50
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -1,3 +1,7 @@
Fri Mar 10 16:37:12 CET 2017
Fix hypothetical integer overflow for very, very large
timeout values. -CG
Fri Mar 10 16:22:54 CET 2017
Handle case that we do not listen at all more gracefully
in MHD_start_daemon() and not pass '-1' to helper functions
+1 -1
View File
@@ -3131,7 +3131,7 @@ MHD_get_timeout (struct MHD_Daemon *daemon,
if (second_left > ULLONG_MAX / 1000)
*timeout = ULLONG_MAX;
else
*timeout = 1000 * second_left;
*timeout = 1000LL * second_left;
}
return MHD_YES;
}