OSDN Git Service

RESTRICT AUTOMERGE: Fixes two bluetooth bugs causing remote overreads (1/2)
authorakirilov <akirilov@google.com>
Mon, 21 May 2018 19:56:17 +0000 (12:56 -0700)
committerRyan Longair <rlongair@google.com>
Tue, 12 Jun 2018 18:27:18 +0000 (11:27 -0700)
Bug: 74075873
Test: manual test (poc in bug)
Change-Id: I56e87cfdf8731acca00cefac98abb2ba06f6e7ed
(cherry picked from commit 3575ba8ca36dccf7dcdb2dbf16ed170d549911d3)

stack/sdp/sdp_discovery.cc

index d3bfd32..0a3e787 100644 (file)
@@ -357,7 +357,7 @@ static void sdp_copy_raw_data(tCONN_CB* p_ccb, bool offset) {
       type = *p++;
       p = sdpu_get_len_from_type(p, type, &list_len);
     }
-    if (list_len && list_len < cpy_len) {
+    if (list_len < cpy_len) {
       cpy_len = list_len;
     }
     rem_len = SDP_MAX_LIST_BYTE_COUNT - (unsigned int)(p - &p_ccb->rsp_list[0]);