X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/7dc9a22ee27a65871bac1166d811d8dbb818fe45..b165006759a81e8ecc4e86e0540fd69343ea46e9:/unix/uxagentc.c diff --git a/unix/uxagentc.c b/unix/uxagentc.c index 9f579cd9..5734a7b0 100644 --- a/unix/uxagentc.c +++ b/unix/uxagentc.c @@ -75,13 +75,12 @@ static int agent_select_result(int fd, int event) } conn->retlen += ret; if (conn->retsize == 4 && conn->retlen == 4) { - conn->retsize = GET_32BIT(conn->retbuf); + conn->retsize = toint(GET_32BIT(conn->retbuf) + 4); if (conn->retsize <= 0) { conn->retbuf = NULL; conn->retlen = 0; goto done; } - conn->retsize += 4; assert(conn->retbuf == conn->sizebuf); conn->retbuf = snewn(conn->retsize, char); memcpy(conn->retbuf, conn->sizebuf, 4);