OSDN Git Service

resolve merge conflicts of a3ee2e35 to nyc-dev
authorPavlin Radoslavov <pavlin@google.com>
Tue, 14 Mar 2017 21:46:15 +0000 (14:46 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Wed, 15 Mar 2017 04:22:19 +0000 (04:22 +0000)
Bug: 34946955
Change-Id: Ieff690edd3aa527a0639483ec8e1e3b661f0ecc4
Merged-In: I0b6f50dee05a58db8c043b4d01fb58c9acbeede9

1  2 
stack/l2cap/l2c_main.c

   *
   ******************************************************************************/
  
 +#define LOG_TAG "bt_l2c_main"
 +
 +#include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
 -#include <stdio.h>
  
 -#include "device/include/controller.h"
 -#include "btcore/include/counter.h"
+ #include <log/log.h>
  #include "bt_target.h"
  #include "btm_int.h"
  #include "btu.h"
@@@ -132,6 -184,14 +134,14 @@@ void l2c_rcv_acl_data (BT_HDR *p_msg
      STREAM_TO_UINT16 (hci_len, p);
      p_msg->offset += 4;
  
 -        GKI_freebuf (p_msg);
+     if (hci_len < L2CAP_PKT_OVERHEAD) {
+         /* Must receive at least the L2CAP length and CID */
+         L2CAP_TRACE_WARNING ("L2CAP - got incorrect hci header");
+         android_errorWriteLog(0x534e4554, "34946955");
++        osi_free(p_msg);
+         return;
+     }
      /* Extract the length and CID */
      STREAM_TO_UINT16 (l2cap_len, p);
      STREAM_TO_UINT16 (rcv_cid, p);