diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2019-07-12 09:18:45 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2019-07-12 09:18:45 +0200 |
commit | ed7b90269a529d90d151969348e55347fae02c0d (patch) | |
tree | 7c72e5a49112a844a53a2c10ef1fda47867aee92 /contributed/libfuzzer-onig.cpp | |
parent | 6cac1738b6aebf75b29d225775030d291319f9a2 (diff) | |
parent | 5c29b174a11e992dac68553f08645fe4a825c315 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'contributed/libfuzzer-onig.cpp')
-rw-r--r-- | contributed/libfuzzer-onig.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/contributed/libfuzzer-onig.cpp b/contributed/libfuzzer-onig.cpp index dcd7c63..e137b73 100644 --- a/contributed/libfuzzer-onig.cpp +++ b/contributed/libfuzzer-onig.cpp @@ -3,14 +3,14 @@ Usage: * compile oniguruma with something like - ./configure CC=clang LD=clang CFLAGS="-fsanitize-coverage=edge -fsanitize=address" \ - LDFLAGS="-fsanitize-coverage=edge -fsanitize=address" + ./configure CC=clang LD=clang CFLAGS="-fsanitize-coverage=edge -fsanitize=address" \ + LDFLAGS="-fsanitize-coverage=edge -fsanitize=address" * Compile libfuzzer stub and link against static libonig.a and libFuzzer.a: - clang++ libfuzzer-onig.cpp src/.libs/libonig.a libFuzzer.a -o libfuzzer-onig \ - -fsanitize-coverage=edge -fsanitize=address + clang++ libfuzzer-onig.cpp src/.libs/libonig.a libFuzzer.a -o libfuzzer-onig \ + -fsanitize-coverage=edge -fsanitize=address * Put sample patterns in directory "in/" * Run - ./libfuzzer-onig in + ./libfuzzer-onig in Consult libfuzzer docs for further details and how to create libFuzzer.a: http://llvm.org/docs/LibFuzzer.html @@ -22,7 +22,7 @@ http://llvm.org/docs/LibFuzzer.html extern "C" int LLVMFuzzerTestOneInput(const uint8_t * Data, size_t Size) { - regex_t *reg; + regex_t *reg; OnigEncoding enc; enc = ONIG_ENCODING_UTF8; @@ -31,13 +31,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * Data, size_t Size) onig_initialize(&enc, 1); #endif - if (onig_new(®, Data, Data + Size, ONIG_OPTION_DEFAULT, enc, + if (onig_new(®, Data, Data + Size, ONIG_OPTION_DEFAULT, enc, ONIG_SYNTAX_DEFAULT, 0) == 0) - onig_free(reg); + onig_free(reg); #ifdef FULL_TEST onig_end(); #endif - return 0; + return 0; } |