OSDN Git Service

Add missing extension length check while parsing BNEP control packets
authorPavlin Radoslavov <pavlin@google.com>
Mon, 17 Jul 2017 23:03:21 +0000 (16:03 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Mon, 17 Jul 2017 23:03:21 +0000 (16:03 -0700)
Bug: 63146237
Test: External script
Change-Id: I4e519cec1c7dffb8bd42add00bd891e0969a3d9f

stack/bnep/bnep_utils.cc

index 3c8e904..ecc7fca 100644 (file)
@@ -830,7 +830,7 @@ uint8_t* bnep_process_control_packet(tBNEP_CONN* p_bcb, uint8_t* p,
       BNEP_TRACE_ERROR("%s: BNEP - bad ctl pkt type: %d", __func__,
                        control_type);
       bnep_send_command_not_understood(p_bcb, control_type);
-      if (is_ext) {
+      if (is_ext && (ext_len > 0)) {
         if (*rem_len < (ext_len - 1)) {
           goto bad_packet_length;
         }