mirror of https://github.com/PurpleI2P/i2pd.git
I2P: End-to-End encrypted and anonymous Internet
https://i2pd.website/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
400 B
33 lines
400 B
1 year ago
|
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include <stddef.h>
|
||
|
|
||
|
#include <Base.h>
|
||
|
|
||
|
#include "fuzzing.h"
|
||
|
|
||
|
|
||
|
bool
|
||
|
fuzzing_testinput(const uint8_t * data, size_t size)
|
||
|
{
|
||
|
size_t outlen;
|
||
|
char * out;
|
||
|
|
||
|
|
||
|
if(size < (2 + 1))
|
||
|
return true;
|
||
|
|
||
|
outlen = (data[0] << 8) | data[1];
|
||
|
outlen++;
|
||
|
|
||
|
data += 2;
|
||
|
size -= 2;
|
||
|
|
||
|
out = new char[outlen];
|
||
|
i2p::data::ByteStreamToBase64(data, size, out, outlen);
|
||
|
delete [] out;
|
||
|
|
||
|
return true;
|
||
|
}
|