X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=proxy.c;h=f9f2cd62df8de99f521dc9588c89be35b5b22f38;hb=54cc0c5b296ee7c27b48a3c8e7aead6e74f2abf1;hp=5b77bc7670b1844a273c1693042502ebf39672e6;hpb=3d4d4004e83f19310d90e6341dbf363a47382ec2;p=PuTTY.git diff --git a/proxy.c b/proxy.c index 5b77bc76..f9f2cd62 100644 --- a/proxy.c +++ b/proxy.c @@ -1246,9 +1246,11 @@ int proxy_socks5_negotiate (Proxy_Socket p, int change) char userpwbuf[255 + 255 + 3]; int ulen, plen; ulen = strlen(username); - if (ulen > 255) ulen = 255; if (ulen < 1) ulen = 1; + if (ulen > 255) ulen = 255; + if (ulen < 1) ulen = 1; plen = strlen(password); - if (plen > 255) plen = 255; if (plen < 1) plen = 1; + if (plen > 255) plen = 255; + if (plen < 1) plen = 1; userpwbuf[0] = 1; /* version number of subnegotiation */ userpwbuf[1] = ulen; memcpy(userpwbuf+2, username, ulen);