Bug 785320 - [b2g-bluetooth] Crash after renaming device in Settings/Bluetooth; r=qdot
authorEric Chou <echou@mozilla.com>
Fri, 24 Aug 2012 20:32:32 -0700
changeset 105402 86b8965a4c7f4993ae61e5dd69b72a799d470406
parent 105401 c7a28dfd1f814fb0ac8a26a53694accfb35383dd
child 105403 c9068173a7da089812e522340c48fb0d3a26f2c4
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersqdot
bugs785320
milestone17.0a1
Bug 785320 - [b2g-bluetooth] Crash after renaming device in Settings/Bluetooth; r=qdot
dom/bluetooth/linux/BluetoothDBusService.cpp
--- a/dom/bluetooth/linux/BluetoothDBusService.cpp
+++ b/dom/bluetooth/linux/BluetoothDBusService.cpp
@@ -1315,17 +1315,18 @@ BluetoothDBusService::SetProperty(Blueto
   void* val;
   nsCString str;
   if (aValue.value().type() == BluetoothValue::Tuint32_t) {
     tmp_int = aValue.value().get_uint32_t();
     val = &tmp_int;
     type = DBUS_TYPE_UINT32;
   } else if (aValue.value().type() == BluetoothValue::TnsString) {
     str = NS_ConvertUTF16toUTF8(aValue.value().get_nsString());
-    val = (void*)str.get();
+    const char* tempStr = str.get();
+    val = &tempStr;
     type = DBUS_TYPE_STRING;
   } else if (aValue.value().type() == BluetoothValue::Tbool) {
     tmp_int = aValue.value().get_bool() ? 1 : 0;
     val = &(tmp_int);
     type = DBUS_TYPE_BOOLEAN;
   } else {
     NS_WARNING("Property type not handled!");
     dbus_message_unref(msg);