system/bt
修訂 | f5543f1027892dc30dfc0d4ddc195a80897308bd (tree) |
---|---|
時間 | 2020-05-08 11:55:55 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Merge tag 'android-8.1.0_r76' into oreo-x86
Android 8.1.0 release 76
@@ -16,6 +16,7 @@ | ||
16 | 16 | |
17 | 17 | #include "service/gatt_server.h" |
18 | 18 | |
19 | +#include "osi/include/log.h" | |
19 | 20 | #include "service/logging_helpers.h" |
20 | 21 | #include "stack/include/bt_types.h" |
21 | 22 |
@@ -114,6 +115,12 @@ bool GattServer::SendResponse(const std::string& device_address, int request_id, | ||
114 | 115 | return false; |
115 | 116 | } |
116 | 117 | |
118 | + if (offset < 0) { | |
119 | + android_errorWriteLog(0x534e4554, "143231677"); | |
120 | + LOG(ERROR) << "Offset is less than 0 offset: " << offset; | |
121 | + return false; | |
122 | + } | |
123 | + | |
117 | 124 | if (value.size() + offset > BTGATT_MAX_ATTR_LEN) { |
118 | 125 | LOG(ERROR) << "Value is too large"; |
119 | 126 | return false; |
@@ -278,7 +278,8 @@ static bool cmac_generate_subkey(BT_OCTET16 key) { | ||
278 | 278 | ******************************************************************************/ |
279 | 279 | bool aes_cipher_msg_auth_code(BT_OCTET16 key, uint8_t* input, uint16_t length, |
280 | 280 | uint16_t tlen, uint8_t* p_signature) { |
281 | - uint16_t len, diff; | |
281 | + uint32_t len; | |
282 | + uint16_t diff; | |
282 | 283 | uint16_t n = (length + BT_OCTET16_LEN - 1) / |
283 | 284 | BT_OCTET16_LEN; /* n is number of rounds */ |
284 | 285 | bool ret = false; |