1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Allow only "localhost" and "" as authorities in URIs. Do not allow escapes (%HH) in the authority part of a URI.

FossilOrigin-Name: b8a0f1b523d1f31c8e7a102ba4bae5935b07104a
This commit is contained in:
dan
2011-05-03 11:53:20 +00:00
parent 78e9dd2b54
commit 3b18a9a334
4 changed files with 37 additions and 11 deletions

View File

@@ -1828,6 +1828,13 @@ int sqlite3ParseUri(
if( zUri[5]=='/' && zUri[6]=='/' ){
iIn = 7;
while( zUri[iIn] && zUri[iIn]!='/' ) iIn++;
if( iIn!=7 && (iIn!=16 || memcmp("localhost", &zUri[7], 9)) ){
*pzErrMsg = sqlite3_mprintf("invalid uri authority: %.*s",
iIn-7, &zUri[7]);
rc = SQLITE_ERROR;
goto parse_uri_out;
}
}else{
iIn = 5;
}