Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54e7fa0a authored by Chris Manton's avatar Chris Manton Committed by Gerrit Code Review
Browse files

Merge changes I63482dad,I69169be1,Ia41b07f8

* changes:
  legacy: Add memory allocation checks
  Add source file for bt_host_test_bta
  legacy: Extract osi_compat from osi lib
parents ed119267 43fd4934
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -173,6 +173,8 @@ cc_test {
        ":TestMockMainShim",
        ":TestMockStack",
        ":TestStubOsi",
        "ar/bta_ar.cc",
        "dm/bta_dm_api.cc",
        "dm/bta_dm_act.cc",
        "dm/bta_dm_cfg.cc",
        "dm/bta_dm_ci.cc",
+1 −0
Original line number Diff line number Diff line
@@ -2883,6 +2883,7 @@ static void bta_dm_set_eir(char* local_name) {

  /* Allocate a buffer to hold HCI command */
  BT_HDR* p_buf = (BT_HDR*)osi_malloc(BTM_CMD_BUF_SIZE);
  ASSERT(p_buf != nullptr);
  p = (uint8_t*)p_buf + BTM_HCI_EIR_OFFSET;

  memset(p, 0x00, HCI_EXT_INQ_RESPONSE_LEN);
+1 −0
Original line number Diff line number Diff line
@@ -630,6 +630,7 @@ bt_property_t* property_deep_copy_array(int num_properties,

    copy = (bt_property_t*)osi_calloc((sizeof(bt_property_t) * num_properties) +
                                      content_len);
    ASSERT(copy != nullptr);
    uint8_t* content = (uint8_t*)(copy + num_properties);

    for (int i = 0; i < num_properties; i++) {
+8 −1
Original line number Diff line number Diff line
@@ -45,6 +45,13 @@ cc_test_library {
    },
}

filegroup {
  name: "OsiCompatSources",
  srcs: [
    "src/compat.cc",
  ],
}

// libosi static library for target
cc_library_static {
    name: "libosi",
@@ -52,12 +59,12 @@ cc_library_static {
    // TODO(mcchou): Remove socket_utils sources after platform specific
    // dependencies are abstracted.
    srcs: [
        ":OsiCompatSources",
        "src/alarm.cc",
        "src/allocation_tracker.cc",
        "src/allocator.cc",
        "src/array.cc",
        "src/buffer.cc",
        "src/compat.cc",
        "src/config.cc",
        "src/fixed_queue.cc",
        "src/future.cc",
+1 −0
Original line number Diff line number Diff line
@@ -1012,6 +1012,7 @@ cc_test {
        "BluetoothGeneratedPackets_h",
    ],
    srcs: [
        ":OsiCompatSources",
        ":TestMockBta",
        ":TestMockBtif",
        ":TestMockHci",