mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Add basic structure for fuzzing targets
General changes: * Add -D/--deterministic command line option as convenience/alternative to -G/--load-seeds (i.e. no file needed, it just uses zero-initialized random seeds). It also changes Broker data stores over to using deterministic timing rather than real time. * Add option to make Reporter abort on runtime scripting errors
This commit is contained in:
parent
f849571910
commit
8f1b34b915
20 changed files with 1290 additions and 928 deletions
24
src/fuzzers/FuzzBuffer.h
Normal file
24
src/fuzzers/FuzzBuffer.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace zeek {
|
||||
|
||||
struct FuzzBuffer {
|
||||
|
||||
static constexpr int PKT_MAGIC_LEN = 4;
|
||||
static constexpr unsigned char PKT_MAGIC[PKT_MAGIC_LEN + 1] = "\1PKT";
|
||||
|
||||
FuzzBuffer(const unsigned char* data, size_t size)
|
||||
: begin(data), end(data + size)
|
||||
{ }
|
||||
|
||||
bool Valid() const;
|
||||
|
||||
int Next(const unsigned char** chunk, size_t* len, bool* is_orig);
|
||||
|
||||
const unsigned char* begin;
|
||||
const unsigned char* end;
|
||||
};
|
||||
|
||||
} // namespace zeek
|
Loading…
Add table
Add a link
Reference in a new issue