mirror of
https://github.com/espressif/openthread.git
synced 2026-08-16 15:47:46 +00:00
[fuzz] process pending tasklets to increase coverage (#3617)
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <openthread/instance.h>
|
||||
#include <openthread/ip6.h>
|
||||
#include <openthread/link.h>
|
||||
#include <openthread/tasklet.h>
|
||||
#include <openthread/thread.h>
|
||||
#include <openthread/thread_ftd.h>
|
||||
#include <openthread/platform/uart.h>
|
||||
@@ -65,6 +66,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
|
||||
otPlatUartReceived(buf, (uint16_t)size);
|
||||
|
||||
while (otTaskletsArePending(instance))
|
||||
{
|
||||
otTaskletsProcess(instance);
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (buf != NULL)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <openthread/ip6.h>
|
||||
#include <openthread/link.h>
|
||||
#include <openthread/message.h>
|
||||
#include <openthread/tasklet.h>
|
||||
#include <openthread/thread.h>
|
||||
#include <openthread/thread_ftd.h>
|
||||
|
||||
@@ -71,6 +72,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
|
||||
message = NULL;
|
||||
|
||||
while (otTaskletsArePending(instance))
|
||||
{
|
||||
otTaskletsProcess(instance);
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (message != NULL)
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <openthread/ip6.h>
|
||||
#include <openthread/link.h>
|
||||
#include <openthread/ncp.h>
|
||||
#include <openthread/tasklet.h>
|
||||
#include <openthread/thread.h>
|
||||
#include <openthread/thread_ftd.h>
|
||||
#include <openthread/platform/uart.h>
|
||||
@@ -65,6 +66,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
|
||||
otPlatUartReceived(buf, (uint16_t)size);
|
||||
|
||||
while (otTaskletsArePending(instance))
|
||||
{
|
||||
otTaskletsProcess(instance);
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (buf != NULL)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <openthread/instance.h>
|
||||
#include <openthread/ip6.h>
|
||||
#include <openthread/link.h>
|
||||
#include <openthread/tasklet.h>
|
||||
#include <openthread/thread.h>
|
||||
#include <openthread/thread_ftd.h>
|
||||
#include <openthread/platform/radio.h>
|
||||
@@ -69,6 +70,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
|
||||
otPlatRadioReceiveDone(instance, &frame, OT_ERROR_NONE);
|
||||
|
||||
while (otTaskletsArePending(instance))
|
||||
{
|
||||
otTaskletsProcess(instance);
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (buf != NULL)
|
||||
|
||||
Reference in New Issue
Block a user