Gerald Pfeifer : icmp: Correctly handle underflow in IcmpSendEcho().

Alexandre Julliard julliard at winehq.org
Thu Dec 6 08:26:43 CST 2007


Module: wine
Branch: master
Commit: 25301a76e61d745df8e1b2962901976a9f6972e0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=25301a76e61d745df8e1b2962901976a9f6972e0

Author: Gerald Pfeifer <gerald at pfeifer.com>
Date:   Wed Dec  5 12:14:55 2007 +0100

icmp: Correctly handle underflow in IcmpSendEcho().

---

 dlls/icmp/icmp_main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/icmp/icmp_main.c b/dlls/icmp/icmp_main.c
index 31bd0c1..8834282 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 */




More information about the wine-cvs mailing list