Bug 989976 - [bluedroid] Hit SIGBUS on unaligned access while doing AdapterPropertiesChangeCallback. r=echou
authorShawn Huang <shuang@mozilla.com>
Tue, 17 Jun 2014 01:38:00 -0400
changeset 189378 05377e8cffbe4c170ba735fccdc34781844d1364
parent 189377 c6404fbb85f0b8e0d3ad0e22230e641560a10a45
child 189379 f818c8089b45c306926055c2fd601b2fc01e3bf5
push id26985
push userryanvm@gmail.com
push dateWed, 18 Jun 2014 19:59:44 +0000
treeherdermozilla-central@00d973a0bdbf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechou
bugs989976
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 989976 - [bluedroid] Hit SIGBUS on unaligned access while doing AdapterPropertiesChangeCallback. r=echou
dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -336,17 +336,19 @@ AdapterPropertiesCallback(bt_status_t aS
                           bt_property_t *aProperties)
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
   BluetoothValue propertyValue;
   InfallibleTArray<BluetoothNamedValue> props;
 
   for (int i = 0; i < aNumProperties; i++) {
-    bt_property_t p = aProperties[i];
+    bt_property_t p;
+    // See Bug 989976, consider aProperties address is not aligned
+    memcpy(&p, &aProperties[i], sizeof(p));
 
     if (p.type == BT_PROPERTY_BDADDR) {
       BdAddressTypeToString((bt_bdaddr_t*)p.val, sAdapterBdAddress);
       propertyValue = sAdapterBdAddress;
       BT_APPEND_NAMED_VALUE(props, "Address", propertyValue);
     } else if (p.type == BT_PROPERTY_BDNAME) {
       // Construct nsCString here because Bd name returned from bluedroid
       // is missing a null terminated character after SetProperty.