bug 383478 deal with %00 in file urls, r=bz,darin

This commit is contained in:
dveditz@cruzio.com 2007-07-12 16:04:24 -07:00
parent 56a324e667
commit a9712ad6f2
4 changed files with 8 additions and 0 deletions

View File

@ -130,6 +130,8 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
}
NS_UnescapeURL(path);
if (path.Length() != strlen(path.get()))
return NS_ERROR_FILE_INVALID_PATH;
// remove leading '\'
if (path.CharAt(0) == '\\')

View File

@ -231,6 +231,8 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
}
NS_UnescapeURL(path);
if (path.Length() != strlen(path.get()))
return NS_ERROR_FILE_INVALID_PATH;
if (bHFSPath)
convertHFSPathtoPOSIX(path, path);

View File

@ -114,6 +114,8 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
}
NS_UnescapeURL(path);
if (path.Length() != strlen(path.get()))
return NS_ERROR_FILE_INVALID_PATH;
if (IsUTF8(path)) {
// speed up the start-up where UTF-8 is the native charset

View File

@ -130,6 +130,8 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
}
NS_UnescapeURL(path);
if (path.Length() != strlen(path.get()))
return NS_ERROR_FILE_INVALID_PATH;
// remove leading '\'
if (path.CharAt(0) == '\\')