Code: static void inbound_data_waiting(void *context) {
 eager_reader_t *reader = (eager_reader_t *)context;

 data_buffer_t *buffer = (data_buffer_t *)reader->allocator->alloc(reader->buffer_size + sizeof(data_buffer_t));
 if (!buffer) {
    LOG_ERROR("%s couldn't aquire memory for inbound data buffer.", __func__);
 return;
 }


   buffer->length = 0;
   buffer->offset = 0;
 
  int bytes_read = read(reader->inbound_fd, buffer->data, reader->buffer_size);
   if (bytes_read > 0) {
     buffer->length = bytes_read;
    fixed_queue_enqueue(reader->buffers, buffer);

    eventfd_write(reader->bytes_available_fd, bytes_read);
 } else {
 if (bytes_read == 0)
      LOG_WARN("%s fd said bytes existed, but none were found.", __func__);
 else
      LOG_WARN("%s unable to read from file descriptor: %s", __func__, strerror(errno));

    reader->allocator->free(buffer);
 }
}

Vulnerability Type: DoS 
CWE ID: CWE-284
Summary: Bluetooth in Android 4.x before 4.4.4, 5.0.x before 5.0.2, 5.1.x before 5.1.1, and 6.x before 2016-08-01 allows attackers to cause a denial of service (loss of Bluetooth 911 functionality) via a crafted application that sends a signal to a Bluetooth process, aka internal bug 28885210.
Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process

Bug: 28885210
Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360

 Conflicts:
	btif/co/bta_hh_co.c
	btif/src/btif_core.c
Merge conflict resolution of ag/1161415 (referencing ag/1164670)
- Directly into mnc-mr2-release
