mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Added undefined behavior sanitizer.
Combined common sanitizer flags. Added fuzzers.
This commit is contained in:
parent
5022a9c610
commit
5f6bbd3eb9
23 changed files with 813 additions and 4 deletions
30
fuzzing/fuzz-NetDb-HandleDatabaseStoreMsg.cc
Normal file
30
fuzzing/fuzz-NetDb-HandleDatabaseStoreMsg.cc
Normal file
|
@ -0,0 +1,30 @@
|
|||
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <I2NPProtocol.h>
|
||||
#include <NetDb.hpp>
|
||||
|
||||
#include "fuzzing.h"
|
||||
|
||||
|
||||
bool
|
||||
fuzzing_testinput(const uint8_t * data, size_t size)
|
||||
{
|
||||
i2p::I2NPMessageType msgType;
|
||||
|
||||
|
||||
if(size < 1)
|
||||
return true;
|
||||
|
||||
msgType = (i2p::I2NPMessageType) data[0];
|
||||
|
||||
data++;
|
||||
size--;
|
||||
|
||||
i2p::data::netdb.HandleDatabaseStoreMsg(
|
||||
i2p::CreateI2NPMessage(msgType, data, size));
|
||||
|
||||
return true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue