Bug 935499. r=honzab, a=lsblakk
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Sat, 16 Nov 2013 18:30:12 +0900
changeset 166520 de6d1ca54ab24b621208ec29adba240c8c895913
parent 166519 bc542226210744ae19a81c47589b9b57d80e7c96
child 166521 12b4725d98b1ec508fe45c1413dc562a275b200f
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershonzab, lsblakk
bugs935499
milestone27.0a2
Bug 935499. r=honzab, a=lsblakk
netwerk/dns/punycode.c
netwerk/test/unit/test_bug935499.js
netwerk/test/unit/xpcshell.ini
--- a/netwerk/dns/punycode.c
+++ b/netwerk/dns/punycode.c
@@ -199,16 +199,20 @@ enum punycode_status punycode_decode(
   const char input[],
   punycode_uint *output_length,
   punycode_uint output[],
   unsigned char case_flags[] )
 {
   punycode_uint n, out, i, max_out, bias,
                  b, j, in, oldi, w, k, digit, t;
 
+  if (!input_length) {
+    return punycode_bad_input;
+  }
+
   /* Initialize the state: */
 
   n = initial_n;
   out = i = 0;
   max_out = *output_length;
   bias = initial_bias;
 
   /* Handle the basic code points:  Let b be the number of input code */
new file mode 100644
--- /dev/null
+++ b/netwerk/test/unit/test_bug935499.js
@@ -0,0 +1,7 @@
+function run_test() {
+  var idnService = Cc["@mozilla.org/network/idn-service;1"]
+                   .getService(Ci.nsIIDNService);
+
+  var isASCII = {};
+  do_check_eq(idnService.convertToDisplayIDN("xn--", isASCII), "xn--");
+}
--- a/netwerk/test/unit/xpcshell.ini
+++ b/netwerk/test/unit/xpcshell.ini
@@ -159,16 +159,17 @@ skip-if = os == "android"
 [test_bug669001.js]
 # Bug 675039: intermittent fail on Android-armv6 
 skip-if = os == "android"
 [test_bug712914_secinfo_validation.js]
 [test_bug770243.js]
 [test_bug894586.js]
 # Allocating 4GB might actually succeed on 64 bit machines
 skip-if = bits != 32
+[test_bug935499.js]
 [test_doomentry.js]
 [test_cacheflags.js]
 # Bug 675039: intermittent fail on Android-armv6 
 skip-if = os == "android"
 [test_cache_jar.js]
 [test_channel_close.js]
 [test_compareURIs.js]
 [test_compressappend.js]