mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07: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
36b666091c
commit
3aeca987aa
@ -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…
Reference in New Issue
Block a user