aboutsummaryrefslogtreecommitdiff
path: root/btif
diff options
context:
space:
mode:
authorSumit Deshmukh <quic_sumitd@quicinc.com>2019-11-26 17:38:03 +0530
committerSumit Deshmukh <quic_sumitd@quicinc.com>2019-11-27 18:28:39 +0530
commit219bf47fa3a882d4c933555a08f884079869790f (patch)
treedf00105448bb27c9e475fa5f0f05010ecac882d8 /btif
parent1b410fbbec99d2adfd24f63d5dbebf79c3fe1a33 (diff)
downloadbt-219bf47fa3a882d4c933555a08f884079869790f.tar.gz
HID [ASan]: Fix for heap buffer overflow issue.
Reproducibility: 100% (with ASan enabled) Use Case: Unpair HID device. Issue: Fatal issue with reason "heap-buffer-overflow" Root cause: Number of arguments supplied did not match with format specifiers which could lead to unpredicted behavior. Fix: Provide equal number of arguments to mentioned format specifiers. Test: Tested by unpairing HID device and issue is not reproducible when ASan is enabled. Fixes: 145188301 Change-Id: I158a4b07dc03d18f83256cdef187033bfdee4b96
Diffstat (limited to 'btif')
-rw-r--r--btif/src/btif_hh.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/btif/src/btif_hh.cc b/btif/src/btif_hh.cc
index 650923a3c..a1df51593 100644
--- a/btif/src/btif_hh.cc
+++ b/btif/src/btif_hh.cc
@@ -537,7 +537,8 @@ bt_status_t btif_hh_virtual_unplug(const RawAddress* bd_addr) {
p_dev = btif_hh_find_dev_by_bda(*bd_addr);
if ((p_dev != NULL) && (p_dev->dev_status == BTHH_CONN_STATE_CONNECTED) &&
(p_dev->attr_mask & HID_VIRTUAL_CABLE)) {
- BTIF_TRACE_DEBUG("%s Sending BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG", __func__);
+ BTIF_TRACE_DEBUG("%s: Sending BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG for: %s", __func__,
+ bd_addr->ToString().c_str());
/* start the timer */
btif_hh_start_vup_timer(bd_addr);
p_dev->local_vup = true;
@@ -545,7 +546,8 @@ bt_status_t btif_hh_virtual_unplug(const RawAddress* bd_addr) {
return BT_STATUS_SUCCESS;
} else if ((p_dev != NULL) &&
(p_dev->dev_status == BTHH_CONN_STATE_CONNECTED)) {
- BTIF_TRACE_ERROR("%s: Virtual unplug not suported, disconnecting device");
+ BTIF_TRACE_ERROR("%s: Virtual unplug not suported, disconnecting device: %s",
+ __func__, bd_addr->ToString().c_str());
/* start the timer */
btif_hh_start_vup_timer(bd_addr);
p_dev->local_vup = true;