Bug 947814 - 0001. Assign length of data. r=vicamo, a=1.3+
authorChuck Lee <chulee@mozilla.com>
Wed, 11 Dec 2013 12:46:16 +0800
changeset 175470 be03830fb191820e99e054f6cafb48d8e96338cf
parent 175469 47c95516b5bba1ea80ad7450d8e0fb262f0a9cb8
child 175471 03cddae242d5e16e66e2f214bf9786a9e62c09cf
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvicamo, 1
bugs947814
milestone28.0a2
Bug 947814 - 0001. Assign length of data. r=vicamo, a=1.3+
dom/wappush/src/gonk/CpPduHelper.jsm
dom/wappush/src/gonk/WapPushManager.js
--- a/dom/wappush/src/gonk/CpPduHelper.jsm
+++ b/dom/wappush/src/gonk/CpPduHelper.jsm
@@ -180,19 +180,19 @@ this.Authenticator = {
       return null;
     }
 
     let authInfo = {
       pass: false,
       checked: false,
       sec: AUTH_SEC_TYPE[sec],
       mac: mac.toUpperCase(),
-      dataLength: wbxml.length,
       data: wbxml
     };
+    authInfo.data.length = wbxml.length;
 
     switch (authInfo.sec) {
       case "NETWPIN":
         let key = getNetworkPin();
         authInfo.pass = this.isValid(wbxml, key, authInfo.mac);
         authInfo.checked = true;
         return authInfo;
 
--- a/dom/wappush/src/gonk/WapPushManager.js
+++ b/dom/wappush/src/gonk/WapPushManager.js
@@ -118,16 +118,17 @@ this.WapPushManager = {
 
       msg = CP.PduHelper.parse(data, contentType);
     } else {
       // Unsupported type, provide raw data.
       msg = {
         contentType: contentType,
         content: data.array
       };
+      msg.content.length = data.array.length;
     }
 
     let sender = PhoneNumberUtils.normalize(options.sourceAddress, false);
     let parsedSender = PhoneNumberUtils.parse(sender);
     if (parsedSender && parsedSender.internationalNumber) {
       sender = parsedSender.internationalNumber;
     }