]> sjero.net Git - wget/commitdiff
[svn] parse_uname() Would run past the end of the string if the
authorhniksic <devnull@localhost>
Wed, 4 Apr 2001 14:00:34 +0000 (07:00 -0700)
committerhniksic <devnull@localhost>
Wed, 4 Apr 2001 14:00:34 +0000 (07:00 -0700)
username was present, but the URL did not contain a slash, e.g.
http://foo:bar@myhost.
Reported by Christian Fraenkel.

src/ChangeLog
src/url.c

index 6fcd4f97edbae164e180a9b59ade3e2e07958e2e..076826cfdcab89c686dfc650ce9e6e3af98a2309 100644 (file)
@@ -1,3 +1,9 @@
+2001-04-04  Christian Fraenkel  <christian.fraenkel@gmx.net>
+
+       * url.c (parse_uname): Would run past the end of the string if the
+       username was present, but the URL did not contain a slash, e.g.
+       http://foo:bar@myhost.
+
 2001-04-03  KOJIMA Hajime  <kjm@rins.ryukoku.ac.jp>
 
        * http.c (http_atotm): Use %A instead of %a to match full
index f91263e66085096915cd26d0b8d9d35be7d151d2..7e31e51ef10c85800691bd230b3d8ff8988042c5 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -622,7 +622,7 @@ parse_uname (const char *url, char **user, char **passwd)
   if (*p != '@')
     return URLOK;
   /* Else find the username and password.  */
-  for (p = q = col = url; *p != '/'; p++)
+  for (p = q = col = url; *p && *p != '/'; p++)
     {
       if (*p == ':' && !*user)
        {