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

Commit e64e87dd authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Fix sizeof warnings on calloc

* This calloc just needs hdr_size bytes, not an array of uint8_t.
* Applied clang-format.

Bug: 261919363
Test: presubmit; tidy-packages-modules-Bluetooth-system-stack-test-fuzzers_subset
Change-Id: I83230f081d797a65f7839a603ca9d98ec8ee121f
parent bb534caf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -132,8 +132,8 @@ std::shared_ptr<BT_HDR> getArbitraryBtHdr(FuzzedDataProvider* fdp) {
  }

  uint16_t hdr_size = bytes.size() + sizeof(BT_HDR);
  std::shared_ptr<BT_HDR> bt_hdr(
      reinterpret_cast<BT_HDR*>(calloc(hdr_size, sizeof(uint8_t))), free);
  std::shared_ptr<BT_HDR> bt_hdr(reinterpret_cast<BT_HDR*>(calloc(1, hdr_size)),
                                 free);

  bt_hdr->event = fdp->ConsumeIntegral<uint16_t>();
  bt_hdr->len = bytes.size();