mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-03 23:47:08 +00:00
test/fuzz: fix memory in l2cap fuzzer
This commit is contained in:
parent
68894c7457
commit
e3ea12006b
@ -213,11 +213,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
static int initialized = 0;
|
||||
if (initialized == 0){
|
||||
initialized = 1;
|
||||
btstack_memory_init();
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
hci_connection.con_handle = 0x0000;
|
||||
}
|
||||
|
||||
btstack_memory_init();
|
||||
|
||||
// prepare test data
|
||||
if (size < 5) return 0;
|
||||
uint8_t packet_type = (data[0] & 1) ? HCI_EVENT_PACKET : HCI_ACL_DATA_PACKET;
|
||||
@ -287,5 +288,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
|
||||
// teardown
|
||||
l2cap_free_channels_fuzz();
|
||||
|
||||
btstack_memory_deinit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user