import from UXP: [libjar] Check Jar entry names for nulls. (aadb6beb)

This commit is contained in:
2026-05-26 00:09:41 +08:00
parent 0ac0961f06
commit ccdbe42159
+5
View File
@@ -365,6 +365,11 @@ nsJARChannel::LookupFile(bool aAllowAsync)
// have e.g. spaces in their filenames.
NS_UnescapeURL(mJarEntry);
if (mJarEntry.FindChar('\0') != -1) {
// Refuse any entries with NULL in them.
return NS_ERROR_MALFORMED_URI;
}
// try to get a nsIFile directly from the url, which will often succeed.
{
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mJarBaseURI);