diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index 195cd4b716..ea90db4873 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -344,6 +344,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 fileURL = do_QueryInterface(mJarBaseURI);