diff --git a/src/ad_parser.c b/src/ad_parser.c index 4efc68845..1778bec79 100644 --- a/src/ad_parser.c +++ b/src/ad_parser.c @@ -109,7 +109,7 @@ bool ad_data_contains_uuid16(uint8_t ad_len, const uint8_t * ad_data, uint16_t u switch (data_type){ case BLUETOOTH_DATA_TYPE_INCOMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS: case BLUETOOTH_DATA_TYPE_COMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS: - for (i=0; i +#include + +#include "ad_parser.h" + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + // ad parser uses uint88_t length + if (size > 255) return 0; + // test ad iterator by calling simple function that uses it + ad_data_contains_uuid16(size, data, 0xffff); + return 0; +}