]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
uri-util: Fixed assertion failure for invalid character in path segment.
authorStephan Bosch <stephan@rename-it.nl>
Sat, 20 Feb 2016 17:47:58 +0000 (19:47 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 20 Feb 2016 17:47:58 +0000 (19:47 +0200)
src/lib/uri-util.c

index 9378c3d74f36fc3924d672e3749ab905504bdeb4..a7d291be36d44f48dc24653a521c67aebd08841c 100644 (file)
@@ -603,6 +603,13 @@ int uri_parse_path_segment(struct uri_parser *parser, const char **segment_r)
                p++;
        }
 
+       if (p < parser->end &&
+               *p != '/' && *p != '?' && *p != '#' ) {
+               parser->error =
+                       "Path component contains invalid character";
+               return -1;
+       }
+
        if (p == parser->cur)
                return 0;