aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/url.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index bd07059bc..3563f0853 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -4482,13 +4482,23 @@ static CURLcode parse_login_details(const char *login, const size_t len,
size_t olen;
/* Attempt to find the password separator */
- if(passwdp)
+ if(passwdp) {
psep = strchr(login, ':');
+ /* Within the constraint of the login string */
+ if(psep >= login + len)
+ psep = NULL;
+ }
+
/* Attempt to find the options separator */
- if(optionsp)
+ if(optionsp) {
osep = strchr(login, ';');
+ /* Within the constraint of the login string */
+ if(osep >= login + len)
+ osep = NULL;
+ }
+
/* Calculate the portion lengths */
ulen = (psep ?
(size_t)(osep && psep > osep ? osep - login : psep - login) :