Skip to content

Commit 644c0a2

Browse files
committed
Fix crash caused by incorrectly formatted device reports.
1 parent fb29f5b commit 644c0a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/Bluefruit52Lib/src/BLEScanner.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ uint8_t BLEScanner::parseReportByType(const uint8_t* scandata, uint8_t scanlen,
147147
uint8_t len = 0;
148148
uint8_t const* ptr = NULL;
149149

150+
if ( scanlen < 2 ) return 0;
151+
150152
// len (1+data), type, data
151153
while ( scanlen )
152154
{

0 commit comments

Comments
 (0)