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

Commit b58a5a0b authored by Myles Watson's avatar Myles Watson Committed by android-build-merger
Browse files

Merge "Bluetooth: Check the number of file descriptors"

am: 6b75bccd

Change-Id: I16d0c95de17649cd5750aad13a7578c3e7c007b0
parents 372e3676 6b75bccd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -226,6 +226,11 @@ bool VendorInterface::Open(InitializeCompleteCallback initialize_complete_cb,
  int fd_list[CH_MAX] = {0};
  int fd_count = lib_interface_->op(BT_VND_OP_USERIAL_OPEN, &fd_list);

  if (fd_count < 1 || fd_count > CH_MAX - 1) {
    ALOGE("%s: fd_count %d is invalid!", __func__, fd_count);
    return false;
  }

  for (int i = 0; i < fd_count; i++) {
    if (fd_list[i] == INVALID_FD) {
      ALOGE("%s: fd %d is invalid!", __func__, fd_list[i]);