X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/b7a189f38294c745ae4ea6efb55891c8196e275b..70e5d0fd16d26307b670972cdfd2a12c21a06572:/proxy.c diff --git a/proxy.c b/proxy.c index d43ad7b4..ce310012 100644 --- a/proxy.c +++ b/proxy.c @@ -321,6 +321,11 @@ static int proxy_for_destination (SockAddr addr, char * hostname, int port) } s = e; + + /* Make sure we really have reached the next comma or end-of-string */ + while (exclude_list[s] && + !isspace(exclude_list[s]) && + exclude_list[s] != ',') s++; } /* no matches in the exclude list, so use the proxy */ @@ -410,7 +415,7 @@ Socket new_connection(SockAddr addr, char *hostname, /* look-up proxy */ proxy_addr = sk_namelookup(cfg.proxy_host, &proxy_canonical_name); - if ((err = sk_addr_error(proxy_addr))) { + if ((err = sk_addr_error(proxy_addr)) != NULL) { ret->error = "Proxy error: Unable to resolve proxy host name"; return (Socket)ret; } @@ -510,7 +515,8 @@ int proxy_http_negotiate (Proxy_Socket p, int change) len = strlen(buf); sprintf(buf2, "Proxy-Authorization: basic "); for (i = 0, j = strlen(buf2); i < len; i += 3, j += 4) - base64_encode_atom(buf+i, (len-i > 3 ? 3 : len-i), buf2+j); + base64_encode_atom((unsigned char *)(buf+i), + (len-i > 3 ? 3 : len-i), buf2+j); strcpy(buf2+j, "\r\n"); sk_write(p->sub_socket, buf2, strlen(buf2)); } @@ -1242,7 +1248,7 @@ int proxy_telnet_negotiate (Proxy_Socket p, int change) /* we only extract two hex characters */ if (i == 1) { - sk_write(p->sub_socket, &v, 1); + sk_write(p->sub_socket, (char *)&v, 1); eo++; break; }