summaryrefslogtreecommitdiff
path: root/harnesses/deluxe-encode-harness.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2019-11-29 11:26:35 +0100
committerJörg Frings-Fürst <debian@jff.email>2019-11-29 11:26:35 +0100
commit4216de6a3336cbc6dddb572cb7e6ab6193bf3729 (patch)
tree327a40dae71db474527a1281a205cc2ebddb2ce6 /harnesses/deluxe-encode-harness.c
parent40f3d0030e6e98bcb02d6523e5ee48497dec49a6 (diff)
New upstream version 6.9.4upstream/6.9.4
Diffstat (limited to 'harnesses/deluxe-encode-harness.c')
-rw-r--r--harnesses/deluxe-encode-harness.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/harnesses/deluxe-encode-harness.c b/harnesses/deluxe-encode-harness.c
index e1f84a5..aabe916 100644
--- a/harnesses/deluxe-encode-harness.c
+++ b/harnesses/deluxe-encode-harness.c
@@ -49,39 +49,6 @@ search(regex_t* reg, unsigned char* str, unsigned char* end)
return 0;
}
-static int
-exec(OnigEncoding enc, OnigOptionType options,
- char* apattern, char* apattern_end, char* astr, char* astr_end)
-{
- int r;
- regex_t* reg;
- OnigErrorInfo einfo;
- UChar* pattern = (UChar* )apattern;
- UChar* str = (UChar* )astr;
- UChar* pattern_end = (UChar* )apattern_end;
- unsigned char *end = (unsigned char* )astr_end;
-
- onig_initialize(&enc, 1);
- onig_set_retry_limit_in_match(DEFAULT_LIMIT);
- onig_set_parse_depth_limit(DEFAULT_LIMIT);
-
- r = onig_new(&reg, pattern, pattern_end,
- options, enc, ONIG_SYNTAX_DEFAULT, &einfo);
- if (r != ONIG_NORMAL) {
- char s[ONIG_MAX_ERROR_MESSAGE_LEN];
- onig_error_code_to_str((UChar* )s, r, &einfo);
- fprintf(stdout, "ERROR: %s\n", s);
- onig_end();
- return -1;
- }
-
- r = search(reg, str, end);
-
- onig_free(reg);
- onig_end();
- return 0;
-}
-
static OnigCaseFoldType CF = ONIGENC_CASE_FOLD_MIN;
static int
@@ -196,15 +163,13 @@ int LLVMFuzzerTestOneInput(const uint8_t * Data, size_t Size)
remaining_size--;
// copy first PATTERN_SIZE bytes off to be the pattern
- pattern = (unsigned char *)malloc(PATTERN_SIZE+4);
- memset(pattern, 0, PATTERN_SIZE+4);
+ pattern = (unsigned char *)malloc(PATTERN_SIZE);
memcpy(pattern, data, PATTERN_SIZE);
pattern_end = pattern + PATTERN_SIZE;
data += PATTERN_SIZE;
remaining_size -= PATTERN_SIZE;
- str = (unsigned char*)malloc(remaining_size+4);
- memset(str, 0, remaining_size+4);
+ str = (unsigned char*)malloc(remaining_size);
memcpy(str, data, remaining_size);
str_end = str + remaining_size;