Fix VTS Fuzz issue
[Description]
Fix is designed to fix VTS Fuzz issue,
1. Add null pointer check in bluetooth_hci.cc and
vendor_interface.cc
2. send should return if open is not done;
3. add lock in callback and set new callback
Bug: 247053367
Test:
1. Build Pass
2. Test VTS fuzz pass
Change-Id: I78da5aeb82f9f78b2b4a156196199183ce0dd8f2
diff --git a/bluetooth/1.0/default/vendor_interface.h b/bluetooth/1.0/default/vendor_interface.h
index 040f31a..2df3946 100644
--- a/bluetooth/1.0/default/vendor_interface.h
+++ b/bluetooth/1.0/default/vendor_interface.h
@@ -22,6 +22,8 @@
#include "bt_vendor_lib.h"
#include "hci_protocol.h"
+extern std::mutex initcb_mutex_;
+
namespace android {
namespace hardware {
namespace bluetooth {
@@ -45,10 +47,9 @@
size_t Send(uint8_t type, const uint8_t* data, size_t length);
void OnFirmwareConfigured(uint8_t result);
-
- private:
virtual ~VendorInterface() = default;
+ private:
bool Open(InitializeCompleteCallback initialize_complete_cb,
PacketReadCallback event_cb, PacketReadCallback acl_cb,
PacketReadCallback sco_cb, PacketReadCallback iso_cb);