Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
LuDuda committed May 23, 2024
1 parent 26ac34a commit e6ba6f0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/fuzz/cli_received.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#include <openthread/cli.h>
#include <openthread/instance.h>
Expand Down Expand Up @@ -68,13 +69,17 @@ void AdvanceTime(otInstance *aInstance, uint32_t aDuration)
}
}

static uint64_t gCounter = 0;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
const otPanId panId = 0xdead;

otInstance *instance = nullptr;
uint8_t *buf = nullptr;

gCounter++;

VerifyOrExit(size <= 65536);

FuzzerPlatformInit();
Expand Down Expand Up @@ -110,5 +115,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
otInstanceFinalize(instance);
}

assert(gCounter<10);

return 0;
}

0 comments on commit e6ba6f0

Please sign in to comment.