summaryrefslogtreecommitdiffstats
path: root/modules/libjar/test/unit/test_corrupt_1801102.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/libjar/test/unit/test_corrupt_1801102.js')
-rw-r--r--modules/libjar/test/unit/test_corrupt_1801102.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/libjar/test/unit/test_corrupt_1801102.js b/modules/libjar/test/unit/test_corrupt_1801102.js
new file mode 100644
index 0000000000..395cf36c7f
--- /dev/null
+++ b/modules/libjar/test/unit/test_corrupt_1801102.js
@@ -0,0 +1,20 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+// Regression test ensuring that that a STORED entry with differing compressed
+// and uncompressed sizes is considered to be corrupt.
+
+add_task(async function test1801102() {
+ let file = do_get_file("data/test_1801102.jar");
+
+ let zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(
+ Ci.nsIZipReader
+ );
+ zipreader.open(file);
+ Assert.throws(
+ () => zipreader.test(""),
+ /NS_ERROR_FILE_CORRUPTED/,
+ "must throw"
+ );
+});