libmicrohttpd

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

commit 97b4296cc09be5216e7cf1b3dce33684864bf75e
parent e5f88887dfcb3eb36f9028b031fb6f932d7538be
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Wed,  8 Jul 2026 11:54:11 +0200

fix possible underflow on timeout computation

Diffstat:
Msrc/microhttpd/daemon.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -4278,13 +4278,15 @@ MHD_get_timeout64 (struct MHD_Daemon *daemon, earliest_deadline = pos->last_activity + pos->connection_timeout_ms; } - for (pos = daemon->manual_timeout_tail; NULL != pos; pos = pos->prevX) + for (pos = daemon->manual_timeout_tail; + NULL != pos; + pos = pos->prevX) { if (0 != pos->connection_timeout_ms) { if ( (NULL == earliest_tmot_conn) || - (earliest_deadline - pos->last_activity > - pos->connection_timeout_ms) ) + (earliest_deadline > + pos->last_activity + pos->connection_timeout_ms) ) { earliest_tmot_conn = pos; earliest_deadline = pos->last_activity + pos->connection_timeout_ms;