diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index 573080644..7d3147045 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -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 fileURL = do_QueryInterface(mJarBaseURI);