From f143fff0db1a5385dd8db84435d14cb05cdcb276 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 28 Aug 2001 12:24:50 +0000 Subject: [PATCH] Semantic fix in the X11 `authentication failed' error packet construction. Doesn't actually affect anything right now, since the bug was a failure to round a length up to the next multiple of 4 and it so happens that our current message was exactly 40 bytes anyway :-) But if we start giving a wider variety of messages one day then it might be handy to be able to do them without gratuitous crashes. [originally from svn r1222] --- x11fwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x11fwd.c b/x11fwd.c index 0e0df203..ac0ff04a 100644 --- a/x11fwd.c +++ b/x11fwd.c @@ -308,7 +308,7 @@ int x11_send(Socket s, char *data, int len) reply[0] = 0; /* failure */ reply[1] = msglen; /* length of reason string */ memcpy(reply + 2, pr->firstpkt + 2, 4); /* major/minor proto vsn */ - PUT_16BIT(pr->firstpkt[0], reply + 6, msglen >> 2); /* data len */ + PUT_16BIT(pr->firstpkt[0], reply + 6, msgsize >> 2);/* data len */ memset(reply + 8, 0, msgsize); memcpy(reply + 8, message, msglen); sshfwd_write(pr->c, reply, 8 + msgsize);