mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Merge remote-tracking branch 'origin/topic/jazoff/fuzz-size-limits'
- I rolled the fuzz chunk limit check into FuzzBuffer::Valid() * origin/topic/jazoff/fuzz-size-limits: Skip fuzz inputs that have more than 64 chunks
This commit is contained in:
commit
ce6459ed6f
2 changed files with 33 additions and 3 deletions
|
@ -27,6 +27,7 @@ public:
|
|||
|
||||
static constexpr int PKT_MAGIC_LEN = 4;
|
||||
static constexpr unsigned char PKT_MAGIC[PKT_MAGIC_LEN + 1] = "\1PKT";
|
||||
static constexpr int MAX_CHUNK_COUNT = 64;
|
||||
|
||||
/**
|
||||
* Initialize fuzz buffer.
|
||||
|
@ -39,9 +40,16 @@ public:
|
|||
|
||||
/**
|
||||
* @return whether the fuzz buffer object is valid -- has enough bytes
|
||||
* to Deliver to an analyzer and starts with a *PKT_MAGIC* bytestring.
|
||||
* to Deliver to an analyzer, starts with a *PKT_MAGIC* bytestring, and
|
||||
* contains less than the limiting number of chunk.
|
||||
* .
|
||||
*/
|
||||
bool Valid() const;
|
||||
bool Valid(int chunk_count_limit = MAX_CHUNK_COUNT) const;
|
||||
|
||||
/**
|
||||
* @return the number of chunks in the fuzz buffer object
|
||||
*/
|
||||
int ChunkCount() const;
|
||||
|
||||
/**
|
||||
* @return the next chunk to deliver, if one could be extracted
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue