X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=x11fwd.c;h=6cfec72824304b8e853802b599c12ed932802a91;hb=9f9d72ec58642e91b4f93ee4405a8086ee2fb2f0;hp=ce572f69a274e3ecd0b5df88d6b91f157ea1a9c3;hpb=bb78583ad29084f16db994d66895917e1b20346e;p=PuTTY.git diff --git a/x11fwd.c b/x11fwd.c index ce572f69..6cfec728 100644 --- a/x11fwd.c +++ b/x11fwd.c @@ -190,7 +190,7 @@ int x11_authcmp(void *av, void *bv) } } -struct X11Display *x11_setup_display(char *display, Conf *conf) +struct X11Display *x11_setup_display(const char *display, Conf *conf) { struct X11Display *disp = snew(struct X11Display); char *localcopy; @@ -230,7 +230,7 @@ struct X11Display *x11_setup_display(char *display, Conf *conf) char *colon, *dot, *slash; char *protocol, *hostname; - colon = strrchr(localcopy, ':'); + colon = host_strrchr(localcopy, ':'); if (!colon) { sfree(disp); sfree(localcopy); @@ -357,10 +357,10 @@ void x11_free_display(struct X11Display *disp) #define XDM_MAXSKEW 20*60 /* 20 minute clock skew should be OK */ -static char *x11_verify(unsigned long peer_ip, int peer_port, - tree234 *authtree, char *proto, - unsigned char *data, int dlen, - struct X11FakeAuth **auth_ret) +static const char *x11_verify(unsigned long peer_ip, int peer_port, + tree234 *authtree, char *proto, + unsigned char *data, int dlen, + struct X11FakeAuth **auth_ret) { struct X11FakeAuth match_dummy; /* for passing to find234 */ struct X11FakeAuth *auth; @@ -420,7 +420,8 @@ static 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; @@ -677,7 +678,7 @@ int x11_get_screen_number(char *display) { int n; - n = strcspn(display, ":"); + n = host_strcspn(display, ":"); if (!display[n]) return 0; n = strcspn(display, ".");