OSDN Git Service

DO NOT MERGE A security fix to check buffer length in l2c_lcc_proc_pdu
authorStanley Tng <stng@google.com>
Tue, 11 Dec 2018 22:45:13 +0000 (14:45 -0800)
committerJP Sugarbroad <jpsugar@google.com>
Mon, 14 Jan 2019 22:55:19 +0000 (14:55 -0800)
commit2736fbc8fcf61e3301f31fec6411f112a7db4720
treef53518616a2de75bc362c0e4b92c7d53eed9b717
parent4a71fca191b41e5931b35e1b9c3a4b74ab170322
DO NOT MERGE A security fix to check buffer length in l2c_lcc_proc_pdu

Add check to make sure that data buffer is big enough to read the 2
bytes for length.

Also, fix a regression from the previous CL that checks the buffer length
before doing a memcpy. The previous check is too strict causing valid
sized buffers to be rejected. The length check is incorrect and off by the header size.

Bug: 120665616
Test: Run the SL4A Test for LE CoC, BleCoCTest
Merged-In: I30b7a8af11d3a5f974cb39e06b0e3463bebc8e9a
Change-Id: I30b7a8af11d3a5f974cb39e06b0e3463bebc8e9a
(cherry picked from commit fcb1994de1f6ee34b8dc6804a2b32e20bf138073)
(cherry picked from commit 1f1d8b97d80d25023c4c7b04d2aa18d367f4158d)
(cherry picked from commit 6b2739f309f7719086eb8201b3e1a35ba60035f4)
(cherry picked from commit c1fcbd5508a75ae3eaf5f311d706d026fee2fe48)
stack/l2cap/l2c_fcr.c