am 66e02987: am d58dee86: Protect from malformed advt with invalid manf_id/data combo

* commit '66e02987b45cb9d04c6bca790dcb3da612e81529':
  Protect from malformed advt with invalid manf_id/data combo
This commit is contained in:
Prerepa Viswanadham
2014-08-14 18:02:58 +00:00
committed by Android Git Automerger

View File

@@ -257,9 +257,11 @@ public final class ScanRecord {
}
return new ScanRecord(serviceUuids, manufacturerData, serviceData,
advertiseFlag, txPowerLevel, localName, scanRecord);
} catch (IndexOutOfBoundsException e) {
} catch (Exception e) {
Log.e(TAG, "unable to parse scan record: " + Arrays.toString(scanRecord));
return null;
// As the record is invalid, ignore all the parsed results for this packet
// and return an empty record with raw scanRecord bytes in results
return new ScanRecord(null, null, null, -1, Integer.MIN_VALUE, null, scanRecord);
}
}