Presence of unexpected characters in the proxy exclude list causes a
[u/mdw/putty] / proxy.c
diff --git a/proxy.c b/proxy.c
index d43ad7b..30a16c5 100644 (file)
--- 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 */