Bug 1018679 - History/Bookmarks migration from Safari fails if the corresponding Property List file uses 3-byte integers. r=mak
authorAsaf Romano <mano@mozilla.com>
Wed, 09 Jul 2014 21:21:47 +0300
changeset 193274 737cb19ee1c488c65665726e3af59c0da98675a5
parent 193273 13d9e025fc86e727793af1d30dbee89993149cde
child 193275 04cf8536314c0159e67831c786ed51d85a61b113
push id27113
push usercbook@mozilla.com
push dateThu, 10 Jul 2014 12:55:14 +0000
treeherdermozilla-central@9c138b12276d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1018679
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1018679 - History/Bookmarks migration from Safari fails if the corresponding Property List file uses 3-byte integers. r=mak
toolkit/modules/PropertyListUtils.jsm
--- a/toolkit/modules/PropertyListUtils.jsm
+++ b/toolkit/modules/PropertyListUtils.jsm
@@ -403,16 +403,24 @@ BinaryPropertyListReader.prototype = {
          offset < aByteOffset + aIntSize * aLength;
          offset += aIntSize) {
       if (aIntSize == 1) {
         uints.push(this._dataView.getUint8(offset));
       }
       else if (aIntSize == 2) {
         uints.push(this._dataView.getUint16(offset));
       }
+      else if (aIntSize == 3) {
+        let int24 = Uint8Array(4);
+        int24[3] = 0;
+        int24[2] = this._dataView.getUint8(offset);
+        int24[1] = this._dataView.getUint8(offset + 1);
+        int24[0] = this._dataView.getUint8(offset + 2);
+        uints.push(Uint32Array(int24.buffer)[0]);
+      }
       else if (aIntSize == 4) {
         uints.push(this._dataView.getUint32(offset));
       }
       else if (aIntSize == 8) {
         let lo = this._dataView.getUint32(offset + 4);
         let hi = this._dataView.getUint32(offset);
         let uint64 = ctypes.UInt64.join(hi, lo);
         if (ctypes.UInt64.compare(uint64, this._JS_MAX_INT_UNSIGNED) == 1) {