mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-25 23:02:09 -05:00

The validation end of XDM-AUTHORIZATION-1 needs to check that two time_t values differ by at most XDM_MAXSKEW, which it was doing by subtracting them and passing the result to abs(). This provoked a warning from OS X's clang, on the reasonable enough basis that the value passed to abs was unsigned. Fixed by using the (well defined) unsigned arithmetic wraparound: to check that the mathematical difference of two unsigned numbers is in the interval [-k,+k], compute their difference _plus k_ as an unsigned, and check the result is in the interval [0,2k] by doing an unsigned comparison against 2k.