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)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Fri, 3 Aug 2018 19:15:57 +0000 (19:15 +0000)
Bug: 74075873
Test: manual test (poc in bug)
Change-Id: I56e87cfdf8731acca00cefac98abb2ba06f6e7ed
(cherry picked from commit 3575ba8ca36dccf7dcdb2dbf16ed170d549911d3)

stack/sdp/sdp_discovery.cc

index b259157..f5dab6e 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;
     }
     SDP_TRACE_WARNING(