Skip to content

Commit

Permalink
change pattern size to be random
Browse files Browse the repository at this point in the history
  • Loading branch information
K.Kosako committed Nov 14, 2019
1 parent e9781e8 commit 681824e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions harnesses/encode-harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ output_data(char* path, const uint8_t * data, size_t size)


#define EXEC_PRINT_INTERVAL 10000000
#define MAX_PATTERN_SIZE 100
#define MAX_PATTERN_SIZE 150

#ifdef SYNTAX_TEST
#define NUM_CONTROL_BYTES 3
Expand Down Expand Up @@ -238,9 +238,14 @@ int LLVMFuzzerTestOneInput(const uint8_t * Data, size_t Size)
data++;
remaining_size--;

pattern_size = remaining_size / 2;
if (pattern_size > MAX_PATTERN_SIZE)
pattern_size = MAX_PATTERN_SIZE;
//pattern_size = remaining_size / 2;
if (remaining_size == 0)
pattern_size = 0;
else {
pattern_size = INPUT_COUNT % remaining_size;
if (pattern_size > MAX_PATTERN_SIZE)
pattern_size = MAX_PATTERN_SIZE;
}

#if defined(UTF16_BE) || defined(UTF16_LE)
if (pattern_size % 2 == 1) pattern_size--;
Expand Down

0 comments on commit 681824e

Please sign in to comment.