mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
bug 383478 deal with %00 in file urls, r=bz,darin
This commit is contained in:
parent
56a324e667
commit
a9712ad6f2
@ -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) == '\\')
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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) == '\\')
|
||||
|
Loading…
x
Reference in New Issue
Block a user