BUG_SSH2_DERIVEKEY is apparently only present in SSH 2.0.11 and
[u/mdw/putty] / proxy.c
diff --git a/proxy.c b/proxy.c
index c1aab15..475dc4a 100644 (file)
--- a/proxy.c
+++ b/proxy.c
@@ -481,7 +481,7 @@ int proxy_http_negotiate (Proxy_Socket p, int change)
            sk_write(p->sub_socket, buf2, strlen(buf2));
        }
 
-       sk_write(p->sub_socket, "\r\n", strlen(buf));
+       sk_write(p->sub_socket, "\r\n", 2);
 
        p->state = 1;
        return 0;
@@ -594,6 +594,7 @@ int proxy_http_negotiate (Proxy_Socket p, int change)
            {
                bufchain_consume(&p->pending_input_data, eol);
                datap += eol;
+               len   -= eol;
                eol = get_line_end(datap, len);
            }
 
@@ -929,7 +930,7 @@ int proxy_socks5_negotiate (Proxy_Socket p, int change)
            char command[22];
            int len;
 
-           if (sk_addrtype(p->remote_addr) == ADDRTYPE_IPV6) {
+           if (sk_addrtype(p->remote_addr) == ADDRTYPE_IPV4) {
                len = 10;
                command[3] = 1; /* IPv4 */
            } else {