libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 2123decd504e9fe024db7efba6d199b3457c7ad9
parent 046ca777629087eb437934ea9bb330e6b0490b8e
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 10 Mar 2017 16:37:57 +0100

fix COV 164298: integer overflow on multiplying timeout

Diffstat:
MChangeLog | 4++++
Msrc/microhttpd/daemon.c | 2+-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -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 diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -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; }