1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/modules/libjar/test/unit/test_bug658093.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,23 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ 1.6 + */ 1.7 + 1.8 +const Cc = Components.classes; 1.9 +const Ci = Components.interfaces; 1.10 + 1.11 +// Check that we don't crash on reading a directory entry signature 1.12 +var ios = Cc["@mozilla.org/network/io-service;1"]. 1.13 + getService(Ci.nsIIOService); 1.14 + 1.15 +function run_test() { 1.16 + var file = do_get_file("data/test_bug658093.zip"); 1.17 + var spec = "jar:" + ios.newFileURI(file).spec + "!/0000"; 1.18 + var channel = ios.newChannel(spec, null, null); 1.19 + var failed = false; 1.20 + try { 1.21 + var stream = channel.open(); 1.22 + } catch (e) { 1.23 + failed = true; 1.24 + } 1.25 + do_check_true(failed); 1.26 +}