Skip to content

Commit a07fbec

Browse files
authored
Merge pull request #140 from swilson/master
Fix crash caused by incorrectly formatted (e.g. 1 byte) device reports.
2 parents fb29f5b + 644c0a2 commit a07fbec

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)