mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-08 07:53:54 +00:00
Bug 458158 - Crash [@ nsJAR::Open] when passing null argument to open method of zip-reader, r+sr=cbiesinger and r=jwalden+bmo
This commit is contained in:
parent
47d464c3ce
commit
c0fae0530d
@ -168,6 +168,7 @@ nsrefcnt nsJAR::Release(void)
|
||||
NS_IMETHODIMP
|
||||
nsJAR::Open(nsIFile* zipFile)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(zipFile);
|
||||
if (mLock) return NS_ERROR_FAILURE; // Already open!
|
||||
|
||||
mZipFile = zipFile;
|
||||
|
11
modules/libjar/test/unit/test_bug458158.js
Normal file
11
modules/libjar/test/unit/test_bug458158.js
Normal file
@ -0,0 +1,11 @@
|
||||
function run_test() {
|
||||
var zReader = Components.classes["@mozilla.org/libjar/zip-reader;1"]
|
||||
.createInstance(Components.interfaces.nsIZipReader);
|
||||
try {
|
||||
zReader.open(null);
|
||||
do_throw("Shouldn't get here!");
|
||||
} catch (e if (e instanceof Components.interfaces.nsIException &&
|
||||
e.result == Components.results.NS_ERROR_NULL_POINTER)) {
|
||||
// do nothing, this test passes
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user