Skip to content

Commit

Permalink
apr_uri_parse(): Do not accept invalid characters in the scheme.
Browse files Browse the repository at this point in the history
Per RFC 3986 3.3, enforce that the first segment of a relative path does
not contain a colon.

PR: 52479


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1462224 13f79535-47bb-0310-9956-ffa450edef68
Stefan Fritsch committed Mar 28, 2013
1 parent d912978 commit e499d78
Showing 3 changed files with 239 additions and 147 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
-*- coding: utf-8 -*-
Changes for APR 2.0.0

*) apr_uri_parse(): Do not accept invalid characters in the scheme.
Per RFC 3986 3.3, enforce that the first segment of a relative path does
not contain a colon. PR 52479. [Stefan Fritsch]

*) Fix pool integrity checks with threads. Add new apr_pool_owner_set()
function. PR 43375, 52785. [Stefan Fritsch]

60 changes: 60 additions & 0 deletions test/testuri.c
Original file line number Diff line number Diff line change
@@ -123,6 +123,66 @@ struct aup_test aup_tests[] =
"file:../photos/image.jpg",
0, "file", NULL, NULL, NULL, NULL, NULL, "../photos/image.jpg", NULL, NULL, 0
},
{
"file+ssh-2:../photos/image.jpg",
0, "file+ssh-2", NULL, NULL, NULL, NULL, NULL, "../photos/image.jpg", NULL, NULL, 0
},
{
"script/foo.js",
0, NULL, NULL, NULL, NULL, NULL, NULL, "script/foo.js", NULL, NULL, 0
},
{
"../foo2.js",
0, NULL, NULL, NULL, NULL, NULL, NULL, "../foo2.js", NULL, NULL, 0
},
{
"foo3.js",
0, NULL, NULL, NULL, NULL, NULL, NULL, "foo3.js", NULL, NULL, 0
},
{
"_foo/bar",
0, NULL, NULL, NULL, NULL, NULL, NULL, "_foo/bar", NULL, NULL, 0
},
{
"_foo:/bar",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
{
"2foo:/bar",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
{
".foo:/bar",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
{
"-foo:/bar",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
{
"+foo:/bar",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
{
"::/bar",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
{
":/bar",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
{
":foo",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
{
":",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
{
"@localhost::8080",
APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0
},
};

struct uph_test {
Loading

0 comments on commit e499d78

Please sign in to comment.