Skip to content

Commit

Permalink
restyled
Browse files Browse the repository at this point in the history
  • Loading branch information
Alami-Amine committed Sep 17, 2024
1 parent 57f5474 commit 3c259d0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/all-clusters-app/linux/fuzzing-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize)
// But maybe we should try to separately extract a PeerAddress and data from
// the incoming data?

//dumping payload with random transport types
// dumping payload with random transport types
std::srand(std::time(0));
Transport::Type randomTransportType = static_cast<Transport::Type>(std::rand() % 5);
Transport::PeerAddress peerAddr(randomTransportType);
Expand All @@ -90,16 +90,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize)
// Ignoring the return value from OnMessageReceived, because we might be
// passing it all sorts of garbage that will cause it to fail.

//for TCP we need to have msgContext
if(randomTransportType == Transport::Type::kTcp)
// for TCP we need to have MessageTransportContext
if (randomTransportType == Transport::Type::kTcp)
{
Transport::MessageTransportContext msgContext;
Server::GetInstance().GetSecureSessionManager().OnMessageReceived(peerAddr, std::move(buf), &msgContext);
}
else
{
Server::GetInstance().GetSecureSessionManager().OnMessageReceived(peerAddr, std::move(buf));

}
// Now process pending events until our sentinel is reached.
PlatformMgr().ScheduleWork([](intptr_t) { PlatformMgr().StopEventLoopTask(); });
Expand Down

0 comments on commit 3c259d0

Please sign in to comment.