]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
uri-util: Improved authority 'host' parse error.
authorStephan Bosch <stephan@rename-it.nl>
Wed, 18 Sep 2013 20:24:22 +0000 (23:24 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Wed, 18 Sep 2013 20:24:22 +0000 (23:24 +0300)
src/lib/uri-util.c

index 04e45c81771b349f085f96a0e6d0a3a028721e51..4e280cf6fe8426258b3833b2b34eec48baabf846 100644 (file)
@@ -543,7 +543,10 @@ int uri_parse_authority(struct uri_parser *parser,
        /* host */
        if ((ret = uri_parse_host(parser, auth)) <= 0) {
                if (ret == 0) {
-                       parser->error = "Missing 'host' component";
+                       if (p == parser->end || *p == ':' || *p == '/')
+                               parser->error = "Missing 'host' component";
+                       else
+                               parser->error = "Invalid 'host' component";
                        return -1;
                }
                return ret;