X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=x11fwd.c;h=bdfc4e743570f9173cf86d82040b593d41fc6e7e;hb=8afae2a5f8104b7a898cec40c78687137c8afa18;hp=e42edf7549dfebc937f1f3675bd6035f384c910f;hpb=b266d671acee34f9305950bfd87054b3b7fcded6;p=PuTTY.git diff --git a/x11fwd.c b/x11fwd.c index e42edf75..bdfc4e74 100644 --- a/x11fwd.c +++ b/x11fwd.c @@ -286,7 +286,8 @@ struct X11Display *x11_setup_display(const char *display, Conf *conf) disp->port = 6000 + disp->displaynum; disp->addr = name_lookup(disp->hostname, disp->port, - &disp->realhost, conf, ADDRTYPE_UNSPEC); + &disp->realhost, conf, ADDRTYPE_UNSPEC, + NULL, NULL); if ((err = sk_addr_error(disp->addr)) != NULL) { sk_addr_free(disp->addr); @@ -420,7 +421,8 @@ static const char *x11_verify(unsigned long peer_ip, int peer_port, if (data[i] != 0) /* zero padding wrong */ return "XDM-AUTHORIZATION-1 data failed check"; tim = time(NULL); - if (abs(t - tim) > XDM_MAXSKEW) + if (((unsigned long)t - (unsigned long)tim + + XDM_MAXSKEW) > 2*XDM_MAXSKEW) return "XDM-AUTHORIZATION-1 time stamp was too far out"; seen = snew(struct XDMSeen); seen->time = t;