From 25301a76e61d745df8e1b2962901976a9f6972e0 Mon Sep 17 00:00:00 2001 From: Gerald Pfeifer Date: Wed, 5 Dec 2007 12:14:55 +0100 Subject: [PATCH] icmp: Correctly handle underflow in IcmpSendEcho(). --- dlls/icmp/icmp_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/icmp/icmp_main.c b/dlls/icmp/icmp_main.c index 31bd0c1b02f..8834282d5e4 100644 --- a/dlls/icmp/icmp_main.c +++ b/dlls/icmp/icmp_main.c @@ -433,8 +433,9 @@ DWORD WINAPI IcmpSendEcho( * Decrease the timeout so that we don't enter an endless loop even * if we get flooded with ICMP packets that are not for us. */ - Timeout -= (recv_time - send_time); - if (Timeout < 0) Timeout = 0; + DWORD t = (recv_time - send_time); + if (Timeout > t) Timeout -= t; + else Timeout = 0; continue; } else { /* This is a reply to our packet */ -- 2.11.4.GIT