Bug 1170971 - Part 2: Fix BluetoothGattAdvData unpacking in daemon backend. r=tzimmermann

This commit is contained in:
Jocelyn Liu 2015-06-04 02:56:00 -04:00
parent 33db16cb89
commit 03ccd9e1cc
2 changed files with 2 additions and 8 deletions

View File

@ -1065,13 +1065,13 @@ public:
return rv;
}
/* Read Length */
size_t length;
uint16_t length;
rv = UnpackPDU(pdu, length);
if (NS_FAILED(rv)) {
return rv;
}
/* Read Adv Data */
rv = UnpackPDU(pdu, aArg3);
rv = UnpackPDU(pdu, UnpackArray<uint8_t>(aArg3.mAdvData, length));
if (NS_FAILED(rv)) {
return rv;
}

View File

@ -939,12 +939,6 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothUuid& aOut)
return aPDU.Read(aOut.mUuid, sizeof(aOut.mUuid));
}
inline nsresult
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattAdvData& aOut)
{
return aPDU.Read(aOut.mAdvData, sizeof(aOut.mAdvData));
}
nsresult
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattId& aOut);