@port-labs/jq-node-bindings 0.0.13 → 0.0.15-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/binding.gyp +41 -19
- package/configure +1 -1
- package/deps/jq/.gitattributes +12 -0
- package/deps/jq/AUTHORS +149 -43
- package/deps/jq/COPYING +75 -1
- package/deps/jq/ChangeLog +2 -2
- package/deps/jq/Makefile.am +106 -65
- package/deps/jq/NEWS.md +391 -0
- package/deps/jq/README.md +54 -52
- package/deps/jq/SECURITY.md +7 -0
- package/deps/jq/compile-ios.sh +106 -102
- package/deps/jq/configure.ac +72 -59
- package/deps/jq/docs/Pipfile +14 -0
- package/deps/jq/docs/Pipfile.lock +415 -0
- package/deps/jq/docs/README.md +15 -14
- package/deps/jq/docs/build_manpage.py +251 -0
- package/deps/jq/docs/build_mantests.py +21 -0
- package/deps/jq/docs/build_website.py +95 -0
- package/deps/jq/docs/content/download/default.yml +249 -0
- package/deps/jq/docs/content/index.yml +83 -0
- package/deps/jq/docs/content/{3.manual/v1.6 → manual/dev}/manual.yml +992 -452
- package/deps/jq/docs/content/{3.manual → manual}/v1.3/manual.yml +105 -116
- package/deps/jq/docs/content/{3.manual → manual}/v1.4/manual.yml +122 -129
- package/deps/jq/docs/content/{3.manual → manual}/v1.5/manual.yml +313 -262
- package/deps/jq/docs/content/{3.manual → manual/v1.6}/manual.yml +407 -332
- package/deps/jq/docs/content/manual/v1.7/manual.yml +3697 -0
- package/deps/jq/docs/content/tutorial/default.yml +337 -0
- package/deps/jq/docs/manual_schema.yml +60 -0
- package/deps/jq/docs/public/css/style.css +99 -0
- package/deps/jq/docs/public/icon.png +0 -0
- package/deps/jq/docs/public/icon.svg +1 -0
- package/deps/jq/docs/public/jq.svg +1 -0
- package/deps/jq/docs/public/js/manual-search.js +31 -49
- package/deps/jq/docs/templates/default.html.j2 +31 -0
- package/deps/jq/docs/templates/index.html.j2 +58 -0
- package/deps/jq/docs/templates/manual.html.j2 +120 -0
- package/deps/jq/docs/templates/shared/_footer.html.j2 +14 -0
- package/deps/jq/docs/templates/shared/_head.html.j2 +23 -0
- package/deps/jq/docs/templates/shared/_navbar.html.j2 +40 -0
- package/deps/jq/docs/validate_manual_schema.py +19 -0
- package/deps/jq/jq.1.prebuilt +1102 -294
- package/deps/jq/jq.spec +2 -3
- package/deps/jq/libjq.pc.in +11 -0
- package/deps/jq/m4/ax_pthread.m4 +522 -0
- package/deps/jq/modules/oniguruma/.travis.yml +17 -0
- package/deps/jq/modules/oniguruma/CMakeLists.txt +206 -41
- package/deps/jq/modules/oniguruma/COPYING +23 -25
- package/deps/jq/modules/oniguruma/HISTORY +368 -23
- package/deps/jq/modules/oniguruma/Makefile.am +61 -7
- package/deps/jq/modules/oniguruma/README +34 -20
- package/deps/jq/modules/oniguruma/README.md +106 -33
- package/deps/jq/modules/oniguruma/README_japanese +183 -0
- package/deps/jq/modules/oniguruma/autogen.sh +9 -0
- package/deps/jq/modules/oniguruma/cmake/Config.cmake.in +4 -0
- package/deps/jq/modules/oniguruma/configure.ac +66 -55
- package/deps/jq/modules/oniguruma/doc/API +485 -42
- package/deps/jq/modules/oniguruma/doc/API.ja +732 -293
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.API +397 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.API.ja +393 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.BUILTIN +95 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.BUILTIN.ja +93 -0
- package/deps/jq/modules/oniguruma/doc/FAQ +3 -3
- package/deps/jq/modules/oniguruma/doc/FAQ.ja +8 -8
- package/deps/jq/modules/oniguruma/doc/RE +223 -63
- package/deps/jq/modules/oniguruma/doc/RE.ja +420 -265
- package/deps/jq/modules/oniguruma/doc/SYNTAX.md +1091 -0
- package/deps/jq/modules/oniguruma/doc/UNICODE_PROPERTIES +840 -697
- package/deps/jq/modules/oniguruma/harnesses/ascii_compatible.dict +113 -0
- package/deps/jq/modules/oniguruma/harnesses/base.c +749 -0
- package/deps/jq/modules/oniguruma/harnesses/deluxe.c +206 -0
- package/deps/jq/modules/oniguruma/harnesses/dict_conv.py +72 -0
- package/deps/jq/modules/oniguruma/harnesses/fuzzer.options +2 -0
- package/deps/jq/modules/oniguruma/harnesses/libfuzzer-onig.cpp +45 -0
- package/deps/jq/modules/oniguruma/harnesses/regset.c +392 -0
- package/deps/jq/modules/oniguruma/index.html +16 -5
- package/deps/jq/modules/oniguruma/index_ja.html +16 -5
- package/deps/jq/modules/oniguruma/make_win.bat +5 -0
- package/deps/jq/modules/oniguruma/make_win32.bat +5 -3
- package/deps/jq/modules/oniguruma/make_win64.bat +5 -3
- package/deps/jq/modules/oniguruma/onig-config.cmake.in +80 -0
- package/deps/jq/modules/oniguruma/onig-config.in +1 -1
- package/deps/jq/modules/oniguruma/oniguruma.pc.cmake.in +1 -1
- package/deps/jq/modules/oniguruma/oniguruma.pc.in +0 -1
- package/deps/jq/modules/oniguruma/sample/CMakeLists.txt +9 -2
- package/deps/jq/modules/oniguruma/sample/Makefile.am +24 -5
- package/deps/jq/modules/oniguruma/sample/bug_fix.c +13 -51
- package/deps/jq/modules/oniguruma/sample/callback_each_match.c +168 -0
- package/deps/jq/modules/oniguruma/sample/callout.c +268 -0
- package/deps/jq/modules/oniguruma/sample/count.c +125 -0
- package/deps/jq/modules/oniguruma/sample/crnl.c +6 -4
- package/deps/jq/modules/oniguruma/sample/echo.c +136 -0
- package/deps/jq/modules/oniguruma/sample/encode.c +53 -146
- package/deps/jq/modules/oniguruma/sample/listcap.c +18 -10
- package/deps/jq/modules/oniguruma/sample/names.c +10 -6
- package/deps/jq/modules/oniguruma/sample/posix.c +13 -2
- package/deps/jq/modules/oniguruma/sample/regset.c +95 -0
- package/deps/jq/modules/oniguruma/sample/scan.c +20 -6
- package/deps/jq/modules/oniguruma/sample/simple.c +8 -4
- package/deps/jq/modules/oniguruma/sample/sql.c +13 -8
- package/deps/jq/modules/oniguruma/sample/syntax.c +11 -10
- package/deps/jq/modules/oniguruma/sample/user_property.c +12 -7
- package/deps/jq/modules/oniguruma/src/Makefile.am +41 -15
- package/deps/jq/modules/oniguruma/src/Makefile.windows +196 -183
- package/deps/jq/modules/oniguruma/src/ascii.c +64 -7
- package/deps/jq/modules/oniguruma/src/big5.c +25 -15
- package/deps/jq/modules/oniguruma/src/config.h.cmake.in +7 -22
- package/deps/jq/modules/oniguruma/src/config.h.win32 +56 -84
- package/deps/jq/modules/oniguruma/src/config.h.win64 +56 -84
- package/deps/jq/modules/oniguruma/src/config.h.windows.in +62 -0
- package/deps/jq/modules/oniguruma/src/cp1251.c +14 -8
- package/deps/jq/modules/oniguruma/src/euc_jp.c +28 -30
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.c +25 -32
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.gperf +1 -2
- package/deps/jq/modules/oniguruma/src/euc_kr.c +27 -15
- package/deps/jq/modules/oniguruma/src/euc_tw.c +40 -17
- package/deps/jq/modules/oniguruma/src/gb18030.c +177 -119
- package/deps/jq/modules/oniguruma/src/gperf_fold_key_conv.py +12 -8
- package/deps/jq/modules/oniguruma/src/gperf_unfold_key_conv.py +8 -6
- package/deps/jq/modules/oniguruma/src/iso8859_1.c +92 -91
- package/deps/jq/modules/oniguruma/src/iso8859_10.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_11.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_13.c +13 -33
- package/deps/jq/modules/oniguruma/src/iso8859_14.c +13 -30
- package/deps/jq/modules/oniguruma/src/iso8859_15.c +13 -34
- package/deps/jq/modules/oniguruma/src/iso8859_16.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_2.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_3.c +13 -33
- package/deps/jq/modules/oniguruma/src/iso8859_4.c +13 -32
- package/deps/jq/modules/oniguruma/src/iso8859_5.c +16 -23
- package/deps/jq/modules/oniguruma/src/iso8859_6.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_7.c +14 -29
- package/deps/jq/modules/oniguruma/src/iso8859_8.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_9.c +13 -33
- package/deps/jq/modules/oniguruma/src/koi8.c +14 -27
- package/deps/jq/modules/oniguruma/src/koi8_r.c +12 -19
- package/deps/jq/modules/oniguruma/src/make_property.sh +21 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_egcb.sh +7 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_egcb_data.py +267 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_fold.sh +25 -11
- package/deps/jq/modules/oniguruma/src/make_unicode_fold_data.py +206 -26
- package/deps/jq/modules/oniguruma/src/make_unicode_property.sh +19 -10
- package/deps/jq/modules/oniguruma/src/make_unicode_property_data.py +474 -375
- package/deps/jq/modules/oniguruma/src/make_unicode_wb.sh +7 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_wb_data.py +267 -0
- package/deps/jq/modules/oniguruma/src/mktable.c +28 -24
- package/deps/jq/modules/oniguruma/src/onig_init.c +2 -2
- package/deps/jq/modules/oniguruma/src/oniggnu.h +7 -5
- package/deps/jq/modules/oniguruma/src/onigposix.h +40 -16
- package/deps/jq/modules/oniguruma/src/oniguruma.h +357 -107
- package/deps/jq/modules/oniguruma/src/regcomp.c +6214 -3933
- package/deps/jq/modules/oniguruma/src/regenc.c +197 -120
- package/deps/jq/modules/oniguruma/src/regenc.h +106 -63
- package/deps/jq/modules/oniguruma/src/regerror.c +112 -91
- package/deps/jq/modules/oniguruma/src/regexec.c +4876 -2010
- package/deps/jq/modules/oniguruma/src/regext.c +8 -8
- package/deps/jq/modules/oniguruma/src/reggnu.c +13 -17
- package/deps/jq/modules/oniguruma/src/regint.h +757 -491
- package/deps/jq/modules/oniguruma/src/regparse.c +7204 -3240
- package/deps/jq/modules/oniguruma/src/regparse.h +361 -218
- package/deps/jq/modules/oniguruma/src/regposerr.c +49 -9
- package/deps/jq/modules/oniguruma/src/regposix.c +106 -24
- package/deps/jq/modules/oniguruma/src/regsyntax.c +66 -13
- package/deps/jq/modules/oniguruma/src/regtrav.c +1 -1
- package/deps/jq/modules/oniguruma/src/regversion.c +6 -4
- package/deps/jq/modules/oniguruma/src/sjis.c +23 -52
- package/deps/jq/modules/oniguruma/src/sjis_prop.c +25 -32
- package/deps/jq/modules/oniguruma/src/sjis_prop.gperf +1 -2
- package/deps/jq/modules/oniguruma/src/st.c +248 -249
- package/deps/jq/modules/oniguruma/src/st.h +4 -5
- package/deps/jq/modules/oniguruma/src/unicode.c +869 -294
- package/deps/jq/modules/oniguruma/src/unicode_egcb_data.c +1419 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold1_key.c +1829 -1300
- package/deps/jq/modules/oniguruma/src/unicode_fold2_key.c +32 -9
- package/deps/jq/modules/oniguruma/src/unicode_fold3_key.c +32 -9
- package/deps/jq/modules/oniguruma/src/unicode_fold_data.c +1210 -984
- package/deps/jq/modules/oniguruma/src/unicode_property_data.c +22480 -15198
- package/deps/jq/modules/oniguruma/src/unicode_property_data_posix.c +1463 -591
- package/deps/jq/modules/oniguruma/src/unicode_unfold_key.c +1958 -1418
- package/deps/jq/modules/oniguruma/src/unicode_wb_data.c +1106 -0
- package/deps/jq/modules/oniguruma/src/utf16_be.c +90 -49
- package/deps/jq/modules/oniguruma/src/utf16_le.c +80 -49
- package/deps/jq/modules/oniguruma/src/utf32_be.c +14 -42
- package/deps/jq/modules/oniguruma/src/utf32_le.c +13 -40
- package/deps/jq/modules/oniguruma/src/utf8.c +33 -78
- package/deps/jq/modules/oniguruma/test/CMakeLists.txt +55 -0
- package/deps/jq/modules/oniguruma/test/Makefile.am +65 -10
- package/deps/jq/modules/oniguruma/test/test.sh +17 -0
- package/deps/jq/modules/oniguruma/test/test_back.c +1450 -0
- package/deps/jq/modules/oniguruma/test/test_options.c +228 -0
- package/deps/jq/modules/oniguruma/test/test_regset.c +466 -0
- package/deps/jq/modules/oniguruma/test/test_syntax.c +365 -0
- package/deps/jq/modules/oniguruma/test/test_utf8.c +1761 -0
- package/deps/jq/modules/oniguruma/test/testc.c +128 -88
- package/deps/jq/modules/oniguruma/test/testp.c +613 -0
- package/deps/jq/modules/oniguruma/test/testu.c +75 -28
- package/deps/jq/modules/oniguruma/tis-ci/stub.c +3 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_back.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_regset.config +20 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_syntax.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_utf8.config +25 -0
- package/deps/jq/modules/oniguruma/tis-ci/testc.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/testu.config +24 -0
- package/deps/jq/modules/oniguruma/tis.config +1336 -0
- package/deps/jq/modules/oniguruma/windows/CMakeLists.txt +8 -0
- package/deps/jq/modules/oniguruma/windows/testc.c +865 -869
- package/deps/jq/scripts/update-website +6 -5
- package/deps/jq/scripts/version +10 -7
- package/deps/jq/sig/jq-release-new.key +29 -0
- package/deps/jq/sig/v1.4/sha256sum.txt +1 -0
- package/deps/jq/sig/v1.5/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.5rc1/sha256sum.txt +1 -0
- package/deps/jq/sig/v1.5rc2/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.6/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.7/jq-1.7.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7/jq-1.7.zip.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7/sha256sum.txt +23 -0
- package/deps/jq/sig/v1.7.1/jq-1.7.1.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-1.7.1.zip.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-osx-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-win64.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/sha256sum.txt +26 -0
- package/deps/jq/sig/v1.7rc1/jq-1.7rc1.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-1.7rc1.zip.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc1/sha256sum.txt +23 -0
- package/deps/jq/sig/v1.7rc2/jq-1.7rc2.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-1.7rc2.zip.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc2/sha256sum.txt +23 -0
- package/deps/jq/src/builtin.c +537 -343
- package/deps/jq/src/builtin.h +18 -0
- package/deps/jq/src/builtin.jq +116 -143
- package/deps/jq/src/bytecode.h +8 -4
- package/deps/jq/src/compile.c +157 -143
- package/deps/jq/src/compile.h +3 -4
- package/deps/jq/src/decNumber/ICU-license.html +45 -0
- package/deps/jq/src/decNumber/decBasic.c +3908 -0
- package/deps/jq/src/decNumber/decCommon.c +1835 -0
- package/deps/jq/src/decNumber/decContext.c +437 -0
- package/deps/jq/src/decNumber/decContext.h +254 -0
- package/deps/jq/src/decNumber/decDPD.h +1185 -0
- package/deps/jq/src/decNumber/decDouble.c +140 -0
- package/deps/jq/src/decNumber/decDouble.h +155 -0
- package/deps/jq/src/decNumber/decNumber.c +8143 -0
- package/deps/jq/src/decNumber/decNumber.h +182 -0
- package/deps/jq/src/decNumber/decNumberLocal.h +757 -0
- package/deps/jq/src/decNumber/decPacked.c +220 -0
- package/deps/jq/src/decNumber/decPacked.h +52 -0
- package/deps/jq/src/decNumber/decQuad.c +135 -0
- package/deps/jq/src/decNumber/decQuad.h +177 -0
- package/deps/jq/src/decNumber/decSingle.c +71 -0
- package/deps/jq/src/decNumber/decSingle.h +86 -0
- package/deps/jq/src/decNumber/decimal128.c +553 -0
- package/deps/jq/src/decNumber/decimal128.h +81 -0
- package/deps/jq/src/decNumber/decimal32.c +476 -0
- package/deps/jq/src/decNumber/decimal32.h +81 -0
- package/deps/jq/src/decNumber/decimal64.c +839 -0
- package/deps/jq/src/decNumber/decimal64.h +83 -0
- package/deps/jq/src/decNumber/decnumber.pdf +0 -0
- package/deps/jq/src/decNumber/example1.c +38 -0
- package/deps/jq/src/decNumber/example2.c +52 -0
- package/deps/jq/src/decNumber/example3.c +64 -0
- package/deps/jq/src/decNumber/example4.c +61 -0
- package/deps/jq/src/decNumber/example5.c +36 -0
- package/deps/jq/src/decNumber/example6.c +61 -0
- package/deps/jq/src/decNumber/example7.c +35 -0
- package/deps/jq/src/decNumber/example8.c +39 -0
- package/deps/jq/src/decNumber/readme.txt +81 -0
- package/deps/jq/src/exec_stack.h +5 -3
- package/deps/jq/src/execute.c +126 -44
- package/deps/jq/src/inject_errors.c +0 -2
- package/deps/jq/src/jq.h +10 -1
- package/deps/jq/src/jq_test.c +222 -11
- package/deps/jq/src/jv.c +807 -176
- package/deps/jq/src/jv.h +22 -1
- package/deps/jq/src/jv_alloc.c +33 -26
- package/deps/jq/src/jv_alloc.h +0 -11
- package/deps/jq/src/jv_aux.c +153 -67
- package/deps/jq/src/jv_dtoa.c +12 -2
- package/deps/jq/src/jv_dtoa_tsd.c +51 -0
- package/deps/jq/src/jv_dtoa_tsd.h +4 -0
- package/deps/jq/src/jv_parse.c +70 -15
- package/deps/jq/src/jv_print.c +56 -60
- package/deps/jq/src/jv_private.h +7 -0
- package/deps/jq/src/jv_thread.h +76 -0
- package/deps/jq/src/jv_unicode.c +18 -0
- package/deps/jq/src/jv_unicode.h +2 -0
- package/deps/jq/src/lexer.c +782 -543
- package/deps/jq/src/lexer.h +438 -64
- package/deps/jq/src/lexer.l +10 -3
- package/deps/jq/src/libm.h +16 -6
- package/deps/jq/src/linker.c +97 -40
- package/deps/jq/src/locfile.c +2 -1
- package/deps/jq/src/main.c +384 -336
- package/deps/jq/src/opcode_list.h +5 -2
- package/deps/jq/src/parser.c +2260 -1898
- package/deps/jq/src/parser.h +115 -98
- package/deps/jq/src/parser.y +124 -89
- package/deps/jq/src/util.c +854 -55
- package/deps/jq/src/util.h +6 -4
- package/deps/jq/tests/jq.test +762 -26
- package/deps/jq/tests/jq_fuzz_compile.c +27 -0
- package/deps/jq/tests/jq_fuzz_execute.cpp +42 -0
- package/deps/jq/tests/jq_fuzz_fixed.cpp +297 -0
- package/deps/jq/tests/jq_fuzz_load_file.c +28 -0
- package/deps/jq/tests/jq_fuzz_parse.c +21 -0
- package/deps/jq/tests/jq_fuzz_parse_extended.c +36 -0
- package/deps/jq/tests/jq_fuzz_parse_stream.c +21 -0
- package/deps/jq/tests/local.supp +14 -0
- package/deps/jq/tests/man.test +979 -0
- package/deps/jq/tests/manonig.test +76 -0
- package/deps/jq/tests/manonigtest +5 -0
- package/deps/jq/tests/mantest +1 -2
- package/deps/jq/tests/modules/home2/.jq/g.jq +1 -0
- package/deps/jq/tests/modules/shadow1.jq +2 -0
- package/deps/jq/tests/modules/shadow2.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order0.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order1.jq +1 -1
- package/deps/jq/tests/modules/test_bind_order2.jq +0 -1
- package/deps/jq/tests/no-main-program.jq +1 -0
- package/deps/jq/tests/onig.test +77 -2
- package/deps/jq/tests/setup +7 -2
- package/deps/jq/tests/shtest +478 -59
- package/deps/jq/tests/uri.test +38 -0
- package/deps/jq/tests/uritest +5 -0
- package/deps/jq/tests/yes-main-program.jq +2 -0
- package/lib/index.js +3 -0
- package/lib/jq.js +15 -1
- package/lib/templateAsync.js +137 -0
- package/package.json +7 -7
- package/src/binding.cc +623 -146
- package/src/binding.h +3 -4
- package/test/santiy-async.test.js +171 -0
- package/test/santiy.test.js +2 -2
- package/test/template-async.test.js +182 -0
- package/test/template.test.js +3 -3
- package/deps/jq/.travis.yml +0 -202
- package/deps/jq/NEWS +0 -89
- package/deps/jq/appveyor.yml +0 -53
- package/deps/jq/docs/Gemfile +0 -7
- package/deps/jq/docs/Gemfile.lock +0 -63
- package/deps/jq/docs/Rakefile +0 -24
- package/deps/jq/docs/Rakefile.manual +0 -49
- package/deps/jq/docs/Rakefile.website +0 -76
- package/deps/jq/docs/content/1.tutorial/default.yml +0 -327
- package/deps/jq/docs/content/2.download/default.yml +0 -193
- package/deps/jq/docs/content/index/index.yml +0 -73
- package/deps/jq/docs/public/css/base.scss +0 -181
- package/deps/jq/docs/public/jq.png +0 -0
- package/deps/jq/docs/site.yml +0 -9
- package/deps/jq/docs/templates/default.liquid +0 -34
- package/deps/jq/docs/templates/index.liquid +0 -73
- package/deps/jq/docs/templates/manual.liquid +0 -99
- package/deps/jq/docs/templates/shared/_footer.liquid +0 -10
- package/deps/jq/docs/templates/shared/_head.liquid +0 -17
- package/deps/jq/docs/templates/shared/_navbar.liquid +0 -27
- package/deps/jq/modules/oniguruma/README.ja +0 -195
- package/deps/jq/modules/oniguruma/cmake/dist.cmake +0 -321
- package/deps/jq/modules/oniguruma/contributed/libfuzzer-onig.cpp +0 -31
- package/deps/jq/modules/oniguruma/dist.info +0 -10
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold1_key.c +0 -2250
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold2_key.c +0 -203
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold3_key.c +0 -113
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold_data.c +0 -1225
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data.c +0 -24742
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data_posix.c +0 -4846
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_unfold_key.c +0 -2571
- /package/deps/jq/sig/{jq-release.key → jq-release-old.key} +0 -0
- /package/deps/jq/tests/modules/{.jq → home1/.jq} +0 -0
|
@@ -0,0 +1,749 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* base.c contributed by Mark Griffin
|
|
3
|
+
* Copyright (c) 2019-2022 K.Kosako
|
|
4
|
+
*/
|
|
5
|
+
#include <stdio.h>
|
|
6
|
+
#include <unistd.h>
|
|
7
|
+
#include <stdlib.h>
|
|
8
|
+
#include <string.h>
|
|
9
|
+
#include <sys/types.h>
|
|
10
|
+
#include <sys/stat.h>
|
|
11
|
+
#include <fcntl.h>
|
|
12
|
+
#include <time.h>
|
|
13
|
+
#include "oniguruma.h"
|
|
14
|
+
|
|
15
|
+
#define PARSE_DEPTH_LIMIT 8
|
|
16
|
+
#define MAX_SUBEXP_CALL_NEST_LEVEL 8
|
|
17
|
+
#define SUBEXP_CALL_LIMIT 1000
|
|
18
|
+
#define BASE_RETRY_LIMIT 20000
|
|
19
|
+
#define BASE_LENGTH 2048
|
|
20
|
+
#define MATCH_STACK_LIMIT 10000000
|
|
21
|
+
#define MAX_REM_SIZE 1048576
|
|
22
|
+
#define MAX_SLOW_REM_SIZE 1024
|
|
23
|
+
#define MAX_SLOW_REM_SIZE2 80
|
|
24
|
+
#define SLOW_RETRY_LIMIT 2000
|
|
25
|
+
#define SLOW_SUBEXP_CALL_LIMIT 100
|
|
26
|
+
#define MAX_SLOW_BACKWARD_REM_SIZE 200
|
|
27
|
+
|
|
28
|
+
//#define EXEC_PRINT_INTERVAL 500000
|
|
29
|
+
//#define DUMP_DATA_INTERVAL 100000
|
|
30
|
+
//#define STAT_PATH "fuzzer.stat_log"
|
|
31
|
+
//#define PREV_CONTROL
|
|
32
|
+
|
|
33
|
+
#ifdef PREV_CONTROL
|
|
34
|
+
#define OPTIONS_AT_COMPILE (ONIG_OPTION_IGNORECASE | ONIG_OPTION_EXTEND | ONIG_OPTION_MULTILINE | ONIG_OPTION_SINGLELINE | ONIG_OPTION_FIND_LONGEST | ONIG_OPTION_FIND_NOT_EMPTY | ONIG_OPTION_NEGATE_SINGLELINE | ONIG_OPTION_DONT_CAPTURE_GROUP | ONIG_OPTION_CAPTURE_GROUP | ONIG_OPTION_WORD_IS_ASCII | ONIG_OPTION_DIGIT_IS_ASCII | ONIG_OPTION_SPACE_IS_ASCII | ONIG_OPTION_POSIX_IS_ASCII | ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER | ONIG_OPTION_TEXT_SEGMENT_WORD)
|
|
35
|
+
#else
|
|
36
|
+
#define OPTIONS_AT_COMPILE (ONIG_OPTION_IGNORECASE | ONIG_OPTION_EXTEND | ONIG_OPTION_MULTILINE | ONIG_OPTION_SINGLELINE | ONIG_OPTION_FIND_LONGEST | ONIG_OPTION_FIND_NOT_EMPTY | ONIG_OPTION_NEGATE_SINGLELINE | ONIG_OPTION_DONT_CAPTURE_GROUP | ONIG_OPTION_CAPTURE_GROUP | ONIG_OPTION_WORD_IS_ASCII | ONIG_OPTION_DIGIT_IS_ASCII | ONIG_OPTION_SPACE_IS_ASCII | ONIG_OPTION_POSIX_IS_ASCII | ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER | ONIG_OPTION_TEXT_SEGMENT_WORD | ONIG_OPTION_IGNORECASE_IS_ASCII)
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
#define OPTIONS_AT_RUNTIME (ONIG_OPTION_NOTBOL | ONIG_OPTION_NOTEOL | ONIG_OPTION_CHECK_VALIDITY_OF_STRING | ONIG_OPTION_NOT_BEGIN_STRING | ONIG_OPTION_NOT_END_STRING | ONIG_OPTION_NOT_BEGIN_POSITION | ONIG_OPTION_CALLBACK_EACH_MATCH)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
#define ADJUST_LEN(enc, len) do {\
|
|
43
|
+
int mlen = ONIGENC_MBC_MINLEN(enc);\
|
|
44
|
+
if (mlen != 1) { len -= len % mlen; }\
|
|
45
|
+
} while (0)
|
|
46
|
+
|
|
47
|
+
typedef unsigned char uint8_t;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
//#define TEST_PATTERN
|
|
51
|
+
|
|
52
|
+
#ifdef TEST_PATTERN
|
|
53
|
+
|
|
54
|
+
#if 1
|
|
55
|
+
unsigned char TestPattern[] = {
|
|
56
|
+
};
|
|
57
|
+
#endif
|
|
58
|
+
|
|
59
|
+
#endif /* TEST_PATTERN */
|
|
60
|
+
|
|
61
|
+
#ifdef STANDALONE
|
|
62
|
+
|
|
63
|
+
static void
|
|
64
|
+
print_options(FILE* fp, OnigOptionType o)
|
|
65
|
+
{
|
|
66
|
+
if ((o & ONIG_OPTION_IGNORECASE) != 0) fprintf(fp, " IGNORECASE");
|
|
67
|
+
if ((o & ONIG_OPTION_EXTEND) != 0) fprintf(fp, " EXTEND");
|
|
68
|
+
if ((o & ONIG_OPTION_MULTILINE) != 0) fprintf(fp, " MULTILINE");
|
|
69
|
+
if ((o & ONIG_OPTION_SINGLELINE) != 0) fprintf(fp, " SINGLELINE");
|
|
70
|
+
if ((o & ONIG_OPTION_FIND_LONGEST) != 0) fprintf(fp, " FIND_LONGEST");
|
|
71
|
+
if ((o & ONIG_OPTION_FIND_NOT_EMPTY) != 0) fprintf(fp, " FIND_NOT_EMPTY");
|
|
72
|
+
if ((o & ONIG_OPTION_NEGATE_SINGLELINE) != 0) fprintf(fp, " NEGATE_SINGLELINE");
|
|
73
|
+
if ((o & ONIG_OPTION_DONT_CAPTURE_GROUP) != 0) fprintf(fp, " DONT_CAPTURE_GROUP");
|
|
74
|
+
if ((o & ONIG_OPTION_CAPTURE_GROUP) != 0) fprintf(fp, " CAPTURE_GROUP");
|
|
75
|
+
if ((o & ONIG_OPTION_NOTBOL) != 0) fprintf(fp, " NOTBOL");
|
|
76
|
+
if ((o & ONIG_OPTION_NOTEOL) != 0) fprintf(fp, " NOTEOL");
|
|
77
|
+
if ((o & ONIG_OPTION_POSIX_REGION) != 0) fprintf(fp, " POSIX_REGION");
|
|
78
|
+
if ((o & ONIG_OPTION_CHECK_VALIDITY_OF_STRING) != 0) fprintf(fp, " CHECK_VALIDITY_OF_STRING");
|
|
79
|
+
if ((o & ONIG_OPTION_IGNORECASE_IS_ASCII) != 0) fprintf(fp, " IGNORECASE_IS_ASCII");
|
|
80
|
+
if ((o & ONIG_OPTION_WORD_IS_ASCII) != 0) fprintf(fp, " WORD_IS_ASCII");
|
|
81
|
+
if ((o & ONIG_OPTION_DIGIT_IS_ASCII) != 0) fprintf(fp, " DIGIT_IS_ASCII");
|
|
82
|
+
if ((o & ONIG_OPTION_SPACE_IS_ASCII) != 0) fprintf(fp, " SPACE_IS_ASCII");
|
|
83
|
+
if ((o & ONIG_OPTION_POSIX_IS_ASCII) != 0) fprintf(fp, " POSIX_IS_ASCII");
|
|
84
|
+
if ((o & ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER) != 0) fprintf(fp, " TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER");
|
|
85
|
+
if ((o & ONIG_OPTION_TEXT_SEGMENT_WORD) != 0) fprintf(fp, " TEXT_SEGMENT_WORD");
|
|
86
|
+
if ((o & ONIG_OPTION_NOT_BEGIN_STRING) != 0) fprintf(fp, " NOT_BIGIN_STRING");
|
|
87
|
+
if ((o & ONIG_OPTION_NOT_END_STRING) != 0) fprintf(fp, " NOT_END_STRING");
|
|
88
|
+
if ((o & ONIG_OPTION_NOT_BEGIN_POSITION) != 0) fprintf(fp, " NOT_BEGIN_POSITION");
|
|
89
|
+
if ((o & ONIG_OPTION_CALLBACK_EACH_MATCH) != 0) fprintf(fp, " CALLBACK_EACH_MATCH");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
static void
|
|
93
|
+
to_binary(unsigned int v, char s[/* 33 */])
|
|
94
|
+
{
|
|
95
|
+
unsigned int mask;
|
|
96
|
+
int i;
|
|
97
|
+
|
|
98
|
+
mask = 1 << (sizeof(v) * 8 - 1);
|
|
99
|
+
i = 0;
|
|
100
|
+
do {
|
|
101
|
+
s[i++] = (mask & v ? '1' : '0');
|
|
102
|
+
} while (mask >>= 1);
|
|
103
|
+
s[i] = 0;
|
|
104
|
+
}
|
|
105
|
+
#endif
|
|
106
|
+
|
|
107
|
+
#ifdef DUMP_INPUT
|
|
108
|
+
static void
|
|
109
|
+
dump_input(unsigned char* data, size_t len)
|
|
110
|
+
{
|
|
111
|
+
static FILE* DumpFp;
|
|
112
|
+
static char end[] = { 'E', 'N', 'D' };
|
|
113
|
+
|
|
114
|
+
if (DumpFp == 0)
|
|
115
|
+
DumpFp = fopen("dump-input", "w");
|
|
116
|
+
|
|
117
|
+
fseek(DumpFp, 0, SEEK_SET);
|
|
118
|
+
fwrite(data, sizeof(unsigned char), len, DumpFp);
|
|
119
|
+
fwrite(end, sizeof(char), sizeof(end), DumpFp);
|
|
120
|
+
fflush(DumpFp);
|
|
121
|
+
}
|
|
122
|
+
#endif
|
|
123
|
+
|
|
124
|
+
#ifdef DUMP_DATA_INTERVAL
|
|
125
|
+
static void
|
|
126
|
+
dump_file(char* path, unsigned char* data, size_t len)
|
|
127
|
+
{
|
|
128
|
+
FILE* fp;
|
|
129
|
+
|
|
130
|
+
fp = fopen(path, "w");
|
|
131
|
+
fwrite(data, sizeof(unsigned char), len, fp);
|
|
132
|
+
fclose(fp);
|
|
133
|
+
}
|
|
134
|
+
#endif
|
|
135
|
+
|
|
136
|
+
#ifdef STANDALONE
|
|
137
|
+
#include <ctype.h>
|
|
138
|
+
|
|
139
|
+
static void
|
|
140
|
+
dump_data(FILE* fp, unsigned char* data, int len)
|
|
141
|
+
{
|
|
142
|
+
int i;
|
|
143
|
+
|
|
144
|
+
fprintf(fp, "{\n");
|
|
145
|
+
for (i = 0; i < len; i++) {
|
|
146
|
+
unsigned char c = data[i];
|
|
147
|
+
|
|
148
|
+
if (isprint((int )c)) {
|
|
149
|
+
if (c == '\\')
|
|
150
|
+
fprintf(fp, " '\\\\'");
|
|
151
|
+
else if (c == '\'')
|
|
152
|
+
fprintf(fp, " '\\''");
|
|
153
|
+
else
|
|
154
|
+
fprintf(fp, " '%c'", c);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
fprintf(fp, "0x%02x", (int )c);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (i == len - 1) {
|
|
161
|
+
fprintf(fp, "\n");
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
if (i % 8 == 7)
|
|
165
|
+
fprintf(fp, ",\n");
|
|
166
|
+
else
|
|
167
|
+
fprintf(fp, ", ");
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
fprintf(fp, "};\n");
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
#else
|
|
174
|
+
|
|
175
|
+
#ifdef EXEC_PRINT_INTERVAL
|
|
176
|
+
static void
|
|
177
|
+
output_current_time(FILE* fp)
|
|
178
|
+
{
|
|
179
|
+
char d[64];
|
|
180
|
+
time_t t;
|
|
181
|
+
|
|
182
|
+
t = time(NULL);
|
|
183
|
+
strftime(d, sizeof(d), "%m/%d %H:%M:%S", localtime(&t));
|
|
184
|
+
|
|
185
|
+
fprintf(fp, "%s", d);
|
|
186
|
+
}
|
|
187
|
+
#endif
|
|
188
|
+
|
|
189
|
+
#endif
|
|
190
|
+
|
|
191
|
+
static int
|
|
192
|
+
progress_callout_func(OnigCalloutArgs* args, void* user_data)
|
|
193
|
+
{
|
|
194
|
+
return ONIG_CALLOUT_SUCCESS;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
static int
|
|
198
|
+
each_match_callback_func(const UChar* str, const UChar* end,
|
|
199
|
+
const UChar* match_start, OnigRegion* region, void* user_data)
|
|
200
|
+
{
|
|
201
|
+
return ONIG_NORMAL;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
static unsigned int calc_retry_limit(sl, len)
|
|
205
|
+
{
|
|
206
|
+
unsigned int r;
|
|
207
|
+
unsigned int upper;
|
|
208
|
+
int heavy;
|
|
209
|
+
|
|
210
|
+
heavy = sl >> 8;
|
|
211
|
+
sl &= 0xff;
|
|
212
|
+
sl += heavy;
|
|
213
|
+
|
|
214
|
+
upper = BASE_RETRY_LIMIT;
|
|
215
|
+
if (sl == 2) {
|
|
216
|
+
upper = SLOW_RETRY_LIMIT;
|
|
217
|
+
}
|
|
218
|
+
else if (sl > 2) {
|
|
219
|
+
upper = SLOW_RETRY_LIMIT * 3 / sl;
|
|
220
|
+
if (upper <= 10) upper = 10;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (len < BASE_LENGTH) {
|
|
224
|
+
r = BASE_RETRY_LIMIT;
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
r = BASE_RETRY_LIMIT * BASE_LENGTH / len;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (r > upper)
|
|
231
|
+
r = upper;
|
|
232
|
+
|
|
233
|
+
return r;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
static int
|
|
237
|
+
search(regex_t* reg, unsigned char* str, unsigned char* end, OnigOptionType options, int backward, int sl)
|
|
238
|
+
{
|
|
239
|
+
int r;
|
|
240
|
+
unsigned char *start, *range;
|
|
241
|
+
OnigRegion *region;
|
|
242
|
+
unsigned int retry_limit;
|
|
243
|
+
size_t len;
|
|
244
|
+
|
|
245
|
+
region = onig_region_new();
|
|
246
|
+
|
|
247
|
+
len = (size_t )(end - str);
|
|
248
|
+
retry_limit = calc_retry_limit(sl, len);
|
|
249
|
+
|
|
250
|
+
onig_set_retry_limit_in_search(retry_limit);
|
|
251
|
+
onig_set_match_stack_limit_size(MATCH_STACK_LIMIT);
|
|
252
|
+
if (sl >= 2)
|
|
253
|
+
onig_set_subexp_call_limit_in_search(SLOW_SUBEXP_CALL_LIMIT);
|
|
254
|
+
else
|
|
255
|
+
onig_set_subexp_call_limit_in_search(SUBEXP_CALL_LIMIT);
|
|
256
|
+
|
|
257
|
+
#ifdef STANDALONE
|
|
258
|
+
fprintf(stdout, "retry limit: %u\n", retry_limit);
|
|
259
|
+
fprintf(stdout, "end - str: %td\n", end - str);
|
|
260
|
+
#endif
|
|
261
|
+
|
|
262
|
+
if (backward != 0) {
|
|
263
|
+
start = end;
|
|
264
|
+
range = str;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
start = str;
|
|
268
|
+
range = end;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
r = onig_search(reg, str, end, start, range, region, (options & OPTIONS_AT_RUNTIME));
|
|
272
|
+
if (r >= 0) {
|
|
273
|
+
#ifdef STANDALONE
|
|
274
|
+
int i;
|
|
275
|
+
|
|
276
|
+
fprintf(stdout, "match at %d (%s)\n", r,
|
|
277
|
+
ONIGENC_NAME(onig_get_encoding(reg)));
|
|
278
|
+
for (i = 0; i < region->num_regs; i++) {
|
|
279
|
+
fprintf(stdout, "%d: (%d-%d)\n", i, region->beg[i], region->end[i]);
|
|
280
|
+
}
|
|
281
|
+
#endif
|
|
282
|
+
}
|
|
283
|
+
else if (r == ONIG_MISMATCH) {
|
|
284
|
+
#ifdef STANDALONE
|
|
285
|
+
fprintf(stdout, "search fail (%s)\n",
|
|
286
|
+
ONIGENC_NAME(onig_get_encoding(reg)));
|
|
287
|
+
#endif
|
|
288
|
+
}
|
|
289
|
+
else { /* error */
|
|
290
|
+
#ifdef STANDALONE
|
|
291
|
+
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
|
|
292
|
+
|
|
293
|
+
onig_error_code_to_str((UChar* )s, r);
|
|
294
|
+
fprintf(stdout, "ERROR: %s\n", s);
|
|
295
|
+
fprintf(stdout, " (%s)\n", ONIGENC_NAME(onig_get_encoding(reg)));
|
|
296
|
+
#endif
|
|
297
|
+
onig_region_free(region, 1 /* 1:free self, 0:free contents only */);
|
|
298
|
+
|
|
299
|
+
if (r == ONIGERR_STACK_BUG ||
|
|
300
|
+
r == ONIGERR_UNDEFINED_BYTECODE ||
|
|
301
|
+
r == ONIGERR_UNEXPECTED_BYTECODE)
|
|
302
|
+
return -2;
|
|
303
|
+
|
|
304
|
+
return -1;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
onig_region_free(region, 1 /* 1:free self, 0:free contents only */);
|
|
308
|
+
return 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
static long INPUT_COUNT;
|
|
312
|
+
static long EXEC_COUNT;
|
|
313
|
+
static long EXEC_COUNT_INTERVAL;
|
|
314
|
+
static long REGEX_SUCCESS_COUNT;
|
|
315
|
+
static long VALID_STRING_COUNT;
|
|
316
|
+
|
|
317
|
+
static int
|
|
318
|
+
exec(OnigEncoding enc, OnigOptionType options, OnigSyntaxType* syntax,
|
|
319
|
+
char* apattern, char* apattern_end,
|
|
320
|
+
char* adata_pattern, char* adata_pattern_end,
|
|
321
|
+
char* astr, UChar* end, int backward, int sl)
|
|
322
|
+
{
|
|
323
|
+
int r;
|
|
324
|
+
regex_t* reg;
|
|
325
|
+
OnigErrorInfo einfo;
|
|
326
|
+
UChar* str = (UChar* )astr;
|
|
327
|
+
UChar* pattern = (UChar* )apattern;
|
|
328
|
+
UChar* pattern_end = (UChar* )apattern_end;
|
|
329
|
+
UChar* data_pattern = (UChar* )adata_pattern;
|
|
330
|
+
UChar* data_pattern_end = (UChar* )adata_pattern_end;
|
|
331
|
+
|
|
332
|
+
EXEC_COUNT++;
|
|
333
|
+
EXEC_COUNT_INTERVAL++;
|
|
334
|
+
|
|
335
|
+
onig_initialize(&enc, 1);
|
|
336
|
+
(void)onig_set_progress_callout(progress_callout_func);
|
|
337
|
+
#ifdef PARSE_DEPTH_LIMIT
|
|
338
|
+
onig_set_parse_depth_limit(PARSE_DEPTH_LIMIT);
|
|
339
|
+
#endif
|
|
340
|
+
onig_set_subexp_call_max_nest_level(MAX_SUBEXP_CALL_NEST_LEVEL);
|
|
341
|
+
onig_set_callback_each_match(each_match_callback_func);
|
|
342
|
+
|
|
343
|
+
r = onig_new(®, pattern, pattern_end,
|
|
344
|
+
(options & OPTIONS_AT_COMPILE), enc, syntax, &einfo);
|
|
345
|
+
if (r != ONIG_NORMAL) {
|
|
346
|
+
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
|
|
347
|
+
onig_error_code_to_str((UChar* )s, r, &einfo);
|
|
348
|
+
#ifdef STANDALONE
|
|
349
|
+
fprintf(stdout, "ERROR: %s\n", s);
|
|
350
|
+
#endif
|
|
351
|
+
onig_end();
|
|
352
|
+
|
|
353
|
+
if (r == ONIGERR_PARSER_BUG ||
|
|
354
|
+
r == ONIGERR_STACK_BUG ||
|
|
355
|
+
r == ONIGERR_UNDEFINED_BYTECODE ||
|
|
356
|
+
r == ONIGERR_UNEXPECTED_BYTECODE) {
|
|
357
|
+
return -2;
|
|
358
|
+
}
|
|
359
|
+
else
|
|
360
|
+
return -1;
|
|
361
|
+
}
|
|
362
|
+
REGEX_SUCCESS_COUNT++;
|
|
363
|
+
|
|
364
|
+
if (data_pattern == pattern ||
|
|
365
|
+
onigenc_is_valid_mbc_string(enc, data_pattern, data_pattern_end) != 0) {
|
|
366
|
+
r = search(reg, data_pattern, data_pattern_end, options, backward, sl);
|
|
367
|
+
if (r == -2) return -2;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (onigenc_is_valid_mbc_string(enc, str, end) != 0) {
|
|
371
|
+
VALID_STRING_COUNT++;
|
|
372
|
+
r = search(reg, str, end, options, backward, sl);
|
|
373
|
+
if (r == -2) return -2;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
onig_free(reg);
|
|
377
|
+
onig_end();
|
|
378
|
+
return 0;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
static size_t
|
|
382
|
+
fix_size(size_t x, OnigEncoding enc, int sl, int backward)
|
|
383
|
+
{
|
|
384
|
+
if (x > MAX_REM_SIZE) x = MAX_REM_SIZE;
|
|
385
|
+
|
|
386
|
+
if (sl > 0) {
|
|
387
|
+
if (sl >= 256) { // 256: exists heavy element
|
|
388
|
+
if (x > MAX_SLOW_REM_SIZE2) x = MAX_SLOW_REM_SIZE2;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
if (x > MAX_SLOW_REM_SIZE) x = MAX_SLOW_REM_SIZE;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
if (backward != 0 && enc == ONIG_ENCODING_GB18030) {
|
|
395
|
+
if (x > MAX_SLOW_BACKWARD_REM_SIZE)
|
|
396
|
+
x = MAX_SLOW_BACKWARD_REM_SIZE;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
ADJUST_LEN(enc, x);
|
|
400
|
+
return x;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
static int
|
|
404
|
+
alloc_exec(OnigEncoding enc, OnigOptionType options, OnigSyntaxType* syntax,
|
|
405
|
+
int backward, int pattern_size, size_t rem_size, unsigned char *data)
|
|
406
|
+
{
|
|
407
|
+
extern int onig_detect_can_be_slow_pattern(const UChar* pattern, const UChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax);
|
|
408
|
+
|
|
409
|
+
int r;
|
|
410
|
+
int sl;
|
|
411
|
+
int data_pattern_size;
|
|
412
|
+
unsigned char *pattern;
|
|
413
|
+
unsigned char *pattern_end;
|
|
414
|
+
unsigned char *data_pattern;
|
|
415
|
+
unsigned char *data_pattern_end;
|
|
416
|
+
unsigned char *str_null_end;
|
|
417
|
+
|
|
418
|
+
#ifdef TEST_PATTERN
|
|
419
|
+
pattern = (unsigned char *)malloc(sizeof(TestPattern));
|
|
420
|
+
memcpy(pattern, TestPattern, sizeof(TestPattern));
|
|
421
|
+
pattern_end = pattern + sizeof(TestPattern);
|
|
422
|
+
#else
|
|
423
|
+
pattern = (unsigned char *)malloc(pattern_size != 0 ? pattern_size : 1);
|
|
424
|
+
pattern_end = pattern + pattern_size;
|
|
425
|
+
memcpy(pattern, data, pattern_size);
|
|
426
|
+
#endif
|
|
427
|
+
|
|
428
|
+
sl = onig_detect_can_be_slow_pattern(pattern, pattern_end, options, enc, syntax);
|
|
429
|
+
#ifdef STANDALONE
|
|
430
|
+
fprintf(stdout, "sl: %d\n", sl);
|
|
431
|
+
#endif
|
|
432
|
+
|
|
433
|
+
data_pattern_size = fix_size(pattern_size, enc, sl, backward);
|
|
434
|
+
|
|
435
|
+
if (
|
|
436
|
+
#ifdef TEST_PATTERN
|
|
437
|
+
1 ||
|
|
438
|
+
#endif
|
|
439
|
+
data_pattern_size != pattern_size) {
|
|
440
|
+
data_pattern = (unsigned char *)malloc(data_pattern_size != 0
|
|
441
|
+
? data_pattern_size : 1);
|
|
442
|
+
data_pattern_end = data_pattern + data_pattern_size;
|
|
443
|
+
memcpy(data_pattern, data, data_pattern_size);
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
data_pattern = pattern;
|
|
447
|
+
data_pattern_end = pattern_end;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
data += pattern_size;
|
|
451
|
+
rem_size -= pattern_size;
|
|
452
|
+
rem_size = fix_size(rem_size, enc, sl, backward);
|
|
453
|
+
#ifdef STANDALONE
|
|
454
|
+
fprintf(stdout, "rem_size: %ld\n", rem_size);
|
|
455
|
+
#endif
|
|
456
|
+
|
|
457
|
+
unsigned char *str = (unsigned char*)malloc(rem_size != 0 ? rem_size : 1);
|
|
458
|
+
memcpy(str, data, rem_size);
|
|
459
|
+
str_null_end = str + rem_size;
|
|
460
|
+
|
|
461
|
+
r = exec(enc, options, syntax,
|
|
462
|
+
(char* )pattern, (char* )pattern_end,
|
|
463
|
+
(char* )data_pattern, (char* )data_pattern_end,
|
|
464
|
+
(char* )str, str_null_end, backward, sl);
|
|
465
|
+
|
|
466
|
+
if (data_pattern != pattern)
|
|
467
|
+
free(data_pattern);
|
|
468
|
+
|
|
469
|
+
free(pattern);
|
|
470
|
+
free(str);
|
|
471
|
+
return r;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
#ifdef PREV_CONTROL
|
|
475
|
+
#ifdef SYNTAX_TEST
|
|
476
|
+
#define NUM_CONTROL_BYTES 7
|
|
477
|
+
#else
|
|
478
|
+
#define NUM_CONTROL_BYTES 6
|
|
479
|
+
#endif
|
|
480
|
+
#else
|
|
481
|
+
#ifdef SYNTAX_TEST
|
|
482
|
+
#define NUM_CONTROL_BYTES 8
|
|
483
|
+
#else
|
|
484
|
+
#define NUM_CONTROL_BYTES 7
|
|
485
|
+
#endif
|
|
486
|
+
#endif
|
|
487
|
+
|
|
488
|
+
int LLVMFuzzerTestOneInput(const uint8_t * Data, size_t Size)
|
|
489
|
+
{
|
|
490
|
+
#if !defined(UTF16_BE) && !defined(UTF16_LE)
|
|
491
|
+
static OnigEncoding encodings[] = {
|
|
492
|
+
ONIG_ENCODING_UTF8,
|
|
493
|
+
ONIG_ENCODING_UTF8,
|
|
494
|
+
ONIG_ENCODING_UTF8,
|
|
495
|
+
ONIG_ENCODING_UTF8,
|
|
496
|
+
ONIG_ENCODING_UTF8,
|
|
497
|
+
ONIG_ENCODING_UTF8,
|
|
498
|
+
ONIG_ENCODING_UTF8,
|
|
499
|
+
ONIG_ENCODING_UTF8,
|
|
500
|
+
ONIG_ENCODING_ASCII,
|
|
501
|
+
ONIG_ENCODING_EUC_JP,
|
|
502
|
+
ONIG_ENCODING_EUC_TW,
|
|
503
|
+
ONIG_ENCODING_EUC_KR,
|
|
504
|
+
ONIG_ENCODING_EUC_CN,
|
|
505
|
+
ONIG_ENCODING_SJIS,
|
|
506
|
+
ONIG_ENCODING_KOI8_R,
|
|
507
|
+
ONIG_ENCODING_CP1251,
|
|
508
|
+
ONIG_ENCODING_BIG5,
|
|
509
|
+
ONIG_ENCODING_GB18030,
|
|
510
|
+
ONIG_ENCODING_UTF16_BE,
|
|
511
|
+
ONIG_ENCODING_UTF16_LE,
|
|
512
|
+
ONIG_ENCODING_UTF16_BE,
|
|
513
|
+
ONIG_ENCODING_UTF16_LE,
|
|
514
|
+
ONIG_ENCODING_UTF32_BE,
|
|
515
|
+
ONIG_ENCODING_UTF32_LE,
|
|
516
|
+
ONIG_ENCODING_UTF32_BE,
|
|
517
|
+
ONIG_ENCODING_UTF32_LE,
|
|
518
|
+
ONIG_ENCODING_ISO_8859_1,
|
|
519
|
+
ONIG_ENCODING_ISO_8859_2,
|
|
520
|
+
ONIG_ENCODING_ISO_8859_3,
|
|
521
|
+
ONIG_ENCODING_ISO_8859_4,
|
|
522
|
+
ONIG_ENCODING_ISO_8859_5,
|
|
523
|
+
ONIG_ENCODING_ISO_8859_6,
|
|
524
|
+
ONIG_ENCODING_ISO_8859_7,
|
|
525
|
+
ONIG_ENCODING_ISO_8859_8,
|
|
526
|
+
ONIG_ENCODING_ISO_8859_9,
|
|
527
|
+
ONIG_ENCODING_ISO_8859_10,
|
|
528
|
+
ONIG_ENCODING_ISO_8859_11,
|
|
529
|
+
ONIG_ENCODING_ISO_8859_13,
|
|
530
|
+
ONIG_ENCODING_ISO_8859_14,
|
|
531
|
+
ONIG_ENCODING_ISO_8859_15,
|
|
532
|
+
ONIG_ENCODING_ISO_8859_16
|
|
533
|
+
};
|
|
534
|
+
unsigned char encoding_choice;
|
|
535
|
+
#endif
|
|
536
|
+
|
|
537
|
+
#ifdef SYNTAX_TEST
|
|
538
|
+
static OnigSyntaxType* syntaxes[] = {
|
|
539
|
+
ONIG_SYNTAX_POSIX_EXTENDED,
|
|
540
|
+
ONIG_SYNTAX_EMACS,
|
|
541
|
+
ONIG_SYNTAX_GREP,
|
|
542
|
+
ONIG_SYNTAX_GNU_REGEX,
|
|
543
|
+
ONIG_SYNTAX_JAVA,
|
|
544
|
+
ONIG_SYNTAX_PERL_NG,
|
|
545
|
+
ONIG_SYNTAX_PYTHON,
|
|
546
|
+
ONIG_SYNTAX_ONIGURUMA
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
#ifdef STANDALONE
|
|
550
|
+
static char* syntax_names[] = {
|
|
551
|
+
"Posix Extended",
|
|
552
|
+
"Emacs",
|
|
553
|
+
"Grep",
|
|
554
|
+
"GNU Regex",
|
|
555
|
+
"Java",
|
|
556
|
+
"Perl+NG",
|
|
557
|
+
"Python",
|
|
558
|
+
"Oniguruma"
|
|
559
|
+
};
|
|
560
|
+
#endif
|
|
561
|
+
|
|
562
|
+
unsigned char syntax_choice;
|
|
563
|
+
#endif
|
|
564
|
+
|
|
565
|
+
int r;
|
|
566
|
+
int backward;
|
|
567
|
+
int pattern_size;
|
|
568
|
+
size_t rem_size;
|
|
569
|
+
unsigned char *data;
|
|
570
|
+
unsigned char pattern_size_choice;
|
|
571
|
+
OnigOptionType options;
|
|
572
|
+
OnigEncoding enc;
|
|
573
|
+
OnigSyntaxType* syntax;
|
|
574
|
+
|
|
575
|
+
#ifndef STANDALONE
|
|
576
|
+
#ifdef EXEC_PRINT_INTERVAL
|
|
577
|
+
static FILE* STAT_FP;
|
|
578
|
+
#endif
|
|
579
|
+
#endif
|
|
580
|
+
|
|
581
|
+
INPUT_COUNT++;
|
|
582
|
+
|
|
583
|
+
#ifdef DUMP_DATA_INTERVAL
|
|
584
|
+
if (INPUT_COUNT % DUMP_DATA_INTERVAL == 0) {
|
|
585
|
+
char path[20];
|
|
586
|
+
sprintf(path, "dump-%ld", INPUT_COUNT);
|
|
587
|
+
dump_file(path, (unsigned char* )Data, Size);
|
|
588
|
+
}
|
|
589
|
+
#endif
|
|
590
|
+
|
|
591
|
+
if (Size < NUM_CONTROL_BYTES) return 0;
|
|
592
|
+
|
|
593
|
+
rem_size = Size;
|
|
594
|
+
data = (unsigned char* )(Data);
|
|
595
|
+
|
|
596
|
+
#ifdef UTF16_BE
|
|
597
|
+
enc = ONIG_ENCODING_UTF16_BE;
|
|
598
|
+
#else
|
|
599
|
+
#ifdef UTF16_LE
|
|
600
|
+
enc = ONIG_ENCODING_UTF16_LE;
|
|
601
|
+
#else
|
|
602
|
+
encoding_choice = data[0];
|
|
603
|
+
data++;
|
|
604
|
+
rem_size--;
|
|
605
|
+
|
|
606
|
+
int num_encodings = sizeof(encodings)/sizeof(encodings[0]);
|
|
607
|
+
enc = encodings[encoding_choice % num_encodings];
|
|
608
|
+
#endif
|
|
609
|
+
#endif
|
|
610
|
+
|
|
611
|
+
#ifdef SYNTAX_TEST
|
|
612
|
+
syntax_choice = data[0];
|
|
613
|
+
data++;
|
|
614
|
+
rem_size--;
|
|
615
|
+
|
|
616
|
+
int num_syntaxes = sizeof(syntaxes)/sizeof(syntaxes[0]);
|
|
617
|
+
syntax = syntaxes[syntax_choice % num_syntaxes];
|
|
618
|
+
#else
|
|
619
|
+
syntax = ONIG_SYNTAX_DEFAULT;
|
|
620
|
+
#endif
|
|
621
|
+
|
|
622
|
+
#ifdef PREV_CONTROL
|
|
623
|
+
if ((data[2] & 0xc0) == 0)
|
|
624
|
+
options = data[0] | (data[1] << 8) | (data[2] << 16);
|
|
625
|
+
#else
|
|
626
|
+
if ((data[3] & 0xc0) == 0)
|
|
627
|
+
options = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
|
|
628
|
+
#endif
|
|
629
|
+
else
|
|
630
|
+
options = data[0] & ONIG_OPTION_IGNORECASE;
|
|
631
|
+
|
|
632
|
+
data++; rem_size--;
|
|
633
|
+
data++; rem_size--;
|
|
634
|
+
data++; rem_size--;
|
|
635
|
+
#ifndef PREV_CONTROL
|
|
636
|
+
data++; rem_size--;
|
|
637
|
+
#endif
|
|
638
|
+
|
|
639
|
+
pattern_size_choice = data[0];
|
|
640
|
+
data++; rem_size--;
|
|
641
|
+
|
|
642
|
+
backward = (data[0] == 0xbb);
|
|
643
|
+
data++; rem_size--;
|
|
644
|
+
|
|
645
|
+
if (backward != 0) {
|
|
646
|
+
options = options & ~ONIG_OPTION_FIND_LONGEST;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
if (rem_size == 0)
|
|
650
|
+
pattern_size = 0;
|
|
651
|
+
else {
|
|
652
|
+
pattern_size = (int )pattern_size_choice % rem_size;
|
|
653
|
+
ADJUST_LEN(enc, pattern_size);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
#ifdef STANDALONE
|
|
657
|
+
{
|
|
658
|
+
char soptions[33];
|
|
659
|
+
|
|
660
|
+
dump_data(stdout, data, pattern_size);
|
|
661
|
+
to_binary(options, soptions);
|
|
662
|
+
#ifdef SYNTAX_TEST
|
|
663
|
+
fprintf(stdout,
|
|
664
|
+
"enc: %s, syntax: %s, pattern_size: %d, back:%d\noptions: %s\n",
|
|
665
|
+
ONIGENC_NAME(enc),
|
|
666
|
+
syntax_names[syntax_choice % num_syntaxes],
|
|
667
|
+
pattern_size, backward, soptions);
|
|
668
|
+
#else
|
|
669
|
+
fprintf(stdout, "enc: %s, pattern_size: %d, back:%d\noptions: %s\n",
|
|
670
|
+
ONIGENC_NAME(enc), pattern_size, backward, soptions);
|
|
671
|
+
#endif
|
|
672
|
+
|
|
673
|
+
print_options(stdout, options);
|
|
674
|
+
fprintf(stdout, "\n");
|
|
675
|
+
}
|
|
676
|
+
#endif
|
|
677
|
+
|
|
678
|
+
#ifdef DUMP_INPUT
|
|
679
|
+
dump_input((unsigned char* )Data, Size);
|
|
680
|
+
#endif
|
|
681
|
+
|
|
682
|
+
r = alloc_exec(enc, options, syntax, backward, pattern_size,
|
|
683
|
+
rem_size, data);
|
|
684
|
+
if (r == -2) exit(-2);
|
|
685
|
+
|
|
686
|
+
#ifndef STANDALONE
|
|
687
|
+
#ifdef EXEC_PRINT_INTERVAL
|
|
688
|
+
if (EXEC_COUNT_INTERVAL == EXEC_PRINT_INTERVAL) {
|
|
689
|
+
float fexec, freg, fvalid;
|
|
690
|
+
|
|
691
|
+
if (STAT_FP == 0) {
|
|
692
|
+
#ifdef STAT_PATH
|
|
693
|
+
STAT_FP = fopen(STAT_PATH, "a");
|
|
694
|
+
#else
|
|
695
|
+
STAT_FP = stdout;
|
|
696
|
+
#endif
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
output_current_time(STAT_FP);
|
|
700
|
+
|
|
701
|
+
if (INPUT_COUNT != 0) { // overflow check
|
|
702
|
+
fexec = (float )EXEC_COUNT / INPUT_COUNT;
|
|
703
|
+
freg = (float )REGEX_SUCCESS_COUNT / INPUT_COUNT;
|
|
704
|
+
fvalid = (float )VALID_STRING_COUNT / INPUT_COUNT;
|
|
705
|
+
|
|
706
|
+
fprintf(STAT_FP, ": %ld: EXEC:%.2f, REG:%.2f, VALID:%.2f\n",
|
|
707
|
+
EXEC_COUNT, fexec, freg, fvalid);
|
|
708
|
+
fflush(STAT_FP);
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
fprintf(STAT_FP, ": ignore (input count overflow)\n");
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
EXEC_COUNT_INTERVAL = 0;
|
|
715
|
+
}
|
|
716
|
+
else if (EXEC_COUNT == 1) {
|
|
717
|
+
output_current_time(stdout);
|
|
718
|
+
fprintf(stdout, ": ------------ START ------------\n");
|
|
719
|
+
}
|
|
720
|
+
#endif
|
|
721
|
+
#endif
|
|
722
|
+
|
|
723
|
+
return r;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
#ifdef STANDALONE
|
|
727
|
+
|
|
728
|
+
#define MAX_INPUT_DATA_SIZE 4194304
|
|
729
|
+
|
|
730
|
+
extern int main(int argc, char* argv[])
|
|
731
|
+
{
|
|
732
|
+
size_t max_size;
|
|
733
|
+
size_t n;
|
|
734
|
+
uint8_t Data[MAX_INPUT_DATA_SIZE];
|
|
735
|
+
|
|
736
|
+
if (argc > 1) {
|
|
737
|
+
max_size = (size_t )atoi(argv[1]);
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
max_size = sizeof(Data);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
n = read(0, Data, max_size);
|
|
744
|
+
fprintf(stdout, "read size: %ld, max_size: %ld\n", n, max_size);
|
|
745
|
+
|
|
746
|
+
LLVMFuzzerTestOneInput(Data, n);
|
|
747
|
+
return 0;
|
|
748
|
+
}
|
|
749
|
+
#endif /* STANDALONE */
|