Check harder for URLs that are not invalid for the particular scheme.
Showing
2 changed files
with
4 additions
and
1 deletions
... | @@ -57,6 +57,9 @@ _url_imap_init (url_t url) | ... | @@ -57,6 +57,9 @@ _url_imap_init (url_t url) |
57 | if (status) | 57 | if (status) |
58 | return status; | 58 | return status; |
59 | 59 | ||
60 | if(!url->host || url->query) | ||
61 | return EINVAL; | ||
62 | |||
60 | /* is it pop? */ | 63 | /* is it pop? */ |
61 | if (strcmp ("imap", url->scheme) != 0) | 64 | if (strcmp ("imap", url->scheme) != 0) |
62 | return EINVAL; | 65 | return EINVAL; | ... | ... |
... | @@ -62,7 +62,7 @@ _url_pop_init (url_t url) | ... | @@ -62,7 +62,7 @@ _url_pop_init (url_t url) |
62 | return EINVAL; | 62 | return EINVAL; |
63 | 63 | ||
64 | /* not valid in a pop url */ | 64 | /* not valid in a pop url */ |
65 | if (url->path || url->query) | 65 | if (url->path || url->query || !url->host) |
66 | return EINVAL; | 66 | return EINVAL; |
67 | 67 | ||
68 | if (url->port == 0) | 68 | if (url->port == 0) | ... | ... |
-
Please register or sign in to post a comment