aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/urlapi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c
index 8287861f7..3183598e2 100644
--- a/lib/urlapi.c
+++ b/lib/urlapi.c
@@ -438,10 +438,10 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u,
*hostname = ++ptr;
/* We could use the login information in the URL so extract it. Only parse
- options if the handler says we should. */
+ options if the handler says we should. Note that 'h' might be NULL! */
ccode = Curl_parse_login_details(login, ptr - login - 1,
&userp, &passwdp,
- h->flags & PROTOPT_URLOPTIONS ?
+ (h && (h->flags & PROTOPT_URLOPTIONS)) ?
&optionsp:NULL);
if(ccode) {
result = CURLUE_MALFORMED_INPUT;