summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Pasanen <dan.pasanen@gmail.com>2017-05-01 18:30:11 -0500
committerDan Pasanen <dan.pasanen@gmail.com>2017-05-01 18:30:11 -0500
commit85d4e422039f7506387631a65a3de394a19a872c (patch)
tree805a7e50c14f2957fadc5dbaea8f69af31e56f4a
parentd17396c201e58e20a883d80303fae100b90a98c1 (diff)
parenta4875a49404c544134df37022ae587a4a3321647 (diff)
downloadandroid_system_bt-staging/cm-14.1_android-7.1.2_r8.tar.gz
android_system_bt-staging/cm-14.1_android-7.1.2_r8.tar.bz2
android_system_bt-staging/cm-14.1_android-7.1.2_r8.zip
Merge tag 'android-7.1.2_r8' into cm-14.1staging/cm-14.1_android-7.1.2_r8
Android 7.1.2 release 8 # gpg: Signature made Mon 01 May 2017 10:39:12 AM CDT # gpg: using DSA key E8AD3F819AB10E78 # gpg: Can't check signature: No public key
-rw-r--r--stack/l2cap/l2c_main.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/stack/l2cap/l2c_main.c b/stack/l2cap/l2c_main.c
index a8407ed71..911ee508c 100644
--- a/stack/l2cap/l2c_main.c
+++ b/stack/l2cap/l2c_main.c
@@ -28,6 +28,8 @@
#include <stdlib.h>
#include <string.h>
+#include <log/log.h>
+
#include "bt_target.h"
#include "btm_int.h"
#include "btu.h"
@@ -132,6 +134,14 @@ void l2c_rcv_acl_data (BT_HDR *p_msg)
STREAM_TO_UINT16 (hci_len, p);
p_msg->offset += 4;
+ 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);
@@ -154,17 +164,8 @@ void l2c_rcv_acl_data (BT_HDR *p_msg)
}
}
- if (hci_len >= L2CAP_PKT_OVERHEAD) /* Must receive at least the L2CAP length and CID.*/
- {
- p_msg->len = hci_len - L2CAP_PKT_OVERHEAD;
- p_msg->offset += L2CAP_PKT_OVERHEAD;
- }
- else
- {
- L2CAP_TRACE_WARNING ("L2CAP - got incorrect hci header" );
- osi_free(p_msg);
- return;
- }
+ p_msg->len = hci_len - L2CAP_PKT_OVERHEAD;
+ p_msg->offset += L2CAP_PKT_OVERHEAD;
if (l2cap_len != p_msg->len)
{