bug 367428 - Tighten resource protocol parsing, r=biesi a=dveditz
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@224071 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsURLHelper.h"
|
||||
#include "nsEscape.h"
|
||||
|
||||
static NS_DEFINE_CID(kResURLCID, NS_RESURL_CID);
|
||||
|
||||
@@ -332,6 +333,10 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result)
|
||||
if (filepath.FindChar(':') != -1)
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
NS_UnescapeURL(filepath);
|
||||
if (filepath.FindChar('\\') != -1)
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
const char *p = path.get() + 1; // path always starts with a slash
|
||||
NS_ASSERTION(*(p-1) == '/', "Path did not begin with a slash!");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user