[fuzz] avoid tasklet execution if platform was reset (#4093)

This commit is contained in:
Jonathan Hui
2019-08-13 08:49:51 -07:00
committed by GitHub
parent 80f982301c
commit 0dde90edcb
7 changed files with 93 additions and 18 deletions
+3 -3
View File
@@ -40,11 +40,9 @@
#include <openthread/thread_ftd.h>
#include <openthread/platform/uart.h>
#include "fuzzer_platform.h"
#include "common/code_utils.hpp"
extern "C" void FuzzerPlatformInit(void);
extern "C" void FuzzerPlatformProcess(otInstance *aInstance);
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
const otPanId panId = 0xdead;
@@ -69,6 +67,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
otPlatUartReceived(buf, (uint16_t)size);
VerifyOrExit(!FuzzerPlatformResetWasRequested());
for (int i = 0; i < MAX_ITERATIONS; i++)
{
while (otTaskletsArePending(instance))