summaryrefslogtreecommitdiff
path: root/dev-libs/oniguruma
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-libs/oniguruma
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-libs/oniguruma')
-rw-r--r--dev-libs/oniguruma/Manifest20
-rw-r--r--dev-libs/oniguruma/files/oniguruma-5.9.3-makefile.patch48
-rw-r--r--dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9224.patch22
-rw-r--r--dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9226.patch39
-rw-r--r--dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9227.patch16
-rw-r--r--dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9228.patch18
-rw-r--r--dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9229.patch43
-rw-r--r--dev-libs/oniguruma/files/oniguruma-6.6.1-build.patch25
-rw-r--r--dev-libs/oniguruma/files/oniguruma-combination-explosion-check.patch13
-rw-r--r--dev-libs/oniguruma/files/oniguruma-gentoo.patch49
-rw-r--r--dev-libs/oniguruma/metadata.xml28
-rw-r--r--dev-libs/oniguruma/oniguruma-5.9.5.ebuild37
-rw-r--r--dev-libs/oniguruma/oniguruma-5.9.6_p1-r1.ebuild47
-rw-r--r--dev-libs/oniguruma/oniguruma-6.4.0.ebuild42
-rw-r--r--dev-libs/oniguruma/oniguruma-6.6.1.ebuild42
15 files changed, 489 insertions, 0 deletions
diff --git a/dev-libs/oniguruma/Manifest b/dev-libs/oniguruma/Manifest
new file mode 100644
index 000000000000..0288d0ed450f
--- /dev/null
+++ b/dev-libs/oniguruma/Manifest
@@ -0,0 +1,20 @@
+AUX oniguruma-5.9.3-makefile.patch 1621 SHA256 3b70fc538a59309661b197607269b7913cccacc1f6eadcad6d6e2757482b9cfb SHA512 0478865cc6ccb3ec5154eb16ed2682b999fd45e7892c10e96662e4a0cda20c5bb0ada8dad2cca5cd88a10d4e11ba43e47a81cbf7b806364274bc8a27733cae07 WHIRLPOOL 41d494618df322ed00895599ebeabbf85e256f685f644941e19d36a3ee45831c979f9db04dce6b2984f24bc8bc95826a3beff349d35bed6a5f70bbe4a61c03ba
+AUX oniguruma-5.9.6-CVE-2017-9224.patch 467 SHA256 1e4bf27e887bd15173c6b7987b712bcc4b0dc77a320931d171ba03adbcee948c SHA512 163e681c7d4578979209016e644b313037035d82f129d6e1cc2e93ed840358a00382c2daed127973f5af2bd11adbb0978bd006428061e29222ef89a2c1142a0d WHIRLPOOL 30b4402fe7c18a2a8205c96fce8295426f5399cd550641e8b07eca904a08c229736a0a38ecb98e75f7537cf98073e60616658806ab6fce2e45a6dd2939bb0188
+AUX oniguruma-5.9.6-CVE-2017-9226.patch 1278 SHA256 42372a5d5fd1124cf38e7ff6fc452ba82acd431fac34a6b11ce55a6a65c4bc56 SHA512 65e725959abc68ae3934e61cabd89a94825bc6b3e3a2fc76586973cacdbf73c9904c8f6a058dcdb2f1b91a38bfacabbc48c65a6094e42758078f30a775316d1c WHIRLPOOL 2c59109aca866a5765ea0d4a03c9c963f2ba1167cb659428e4d39ba8b8530d50cd458f2323b5785d95aa0f4bc57ceb9c96119b01254eeb9b65041a104a27eea1
+AUX oniguruma-5.9.6-CVE-2017-9227.patch 376 SHA256 6b98951fab332c86dd6338e7e778934592787ec463027fb1fad7308d12e68708 SHA512 70c4f985b547063338a39cc6ab7812cb53dd3998b9cce60f71c40cf3911dc2f31b66c8cf9ae543763ceed071737288ff811a474e1562a086cc32d98e0cf9b0b2 WHIRLPOOL 5d53482f853fa80f7548b224fecea75e3f34b914d503723db645aabc0448da8421f59ac55866e7d613ea6265bcbce5c60f71e44a3f200eac6a246d7f0ec71dab
+AUX oniguruma-5.9.6-CVE-2017-9228.patch 354 SHA256 ad770fa8f3522ab09d860e8ab077d4978509b075dc0ca94d03fbc80a8a56259b SHA512 f87dd5b1afaad7069116afc17ca73ca77c165b31fe4d7c2d5c54609bf5a30c2d81ba2fb1c461bd6e3a9c7e518363adb10ca900ecc42f397c69337f7989cbd5e9 WHIRLPOOL a5fa1a249244e01de941ed30884d14cff1f41b4ad1cb601cc10268f716dc0aad63f62bab6a4c5d81e025a357c4b556703d5e88feb67ffa9f04321046a36c5b65
+AUX oniguruma-5.9.6-CVE-2017-9229.patch 1311 SHA256 84b54b6f1169e798cf1a52b1d7c1eec883bd40018e1ecec0d2539d765e6845c5 SHA512 eaae2b40b15f261ddb380ea188eba341094a8ec174143a054cddb902352579df1a057c5060f6873710bc9445bcdc6c0d9ca9e692d82ff66b1cfc9ceba9ae5d8a WHIRLPOOL 6332ec58c1b1c34646e89321dc2d6526b29040921da27de87c922139ecd062ec129cbc29c7362b3f3478c4c8729e5d05c568481521c285d7f809844f9b3cd5bd
+AUX oniguruma-6.6.1-build.patch 656 SHA256 2e884c1fa657aa4d56ff5513ab4178477195538acde8723bfef927d3d2c71789 SHA512 44190842324010cf9389b6269e041bac5e128324f5ba7cfdf5cbe6770020325d7e802c71f1c138b4e181d81fb6f53f7cdfe58f9b1c25cc4ca90e23d4d63c3397 WHIRLPOOL 294d5b3593b3ec5dc5d5f7793d314f97599b6e391b580f06b57b3d404e41b1b33299ba9fec2ebb5f8a974a8a8ac91bc545b6488f74eb1bafda511c6f6537ae74
+AUX oniguruma-combination-explosion-check.patch 417 SHA256 1a3ed436f3600d58a57ed2fdf3e2f1a7ed18f26de7b28c023f7ec58e42900947 SHA512 2a163eac5f214bf82fed0c2229f5415947886602c8d929421cac762ccc7158c0120d316ca08449a88785ef196812c3426525d4eedd0b4d8c9bf53de77c49eb4c WHIRLPOOL 661836d0a4877996034fc45cc7624b3f8ac4b75018b03ef770cb101578de1a218b892d7b57aba3d199ce45f9092e64e9ea98ed3a33f50c89eaf64141861a7e87
+AUX oniguruma-gentoo.patch 1502 SHA256 4f0e02eb0fe6f641d1913c587a740f7f1e5b85586aab1fd3c96f9c038f534df2 SHA512 fc7c017a60778ff665df3a178604136754e72ab51b016ceb6f164c72ed66f442e77981cd14563dc0c84948e66ad37416d9e6b431387bb664d660c7343e0cc367 WHIRLPOOL 13ff6184ce797259dfd9e45991a16d47481ed0bc0e6d9ed87f32ade86805404bc0cf8debad943d80bdb7d424b970e8f83675e0d8417101ca004d57c46355e201
+DIST onig-5.9.5.tar.gz 587874 SHA256 9f49ae7819a5f47e25449d0e4b010d479f7868a24a7b9884b47041b49a76438a SHA512 3ba3c94c5e52c80c680ebf1d19be53fa5a94a11d622e0282184c7a9c8cc6676f1926b97d12aafc66514071e65cd7de2bd4632afb053c69b01ddb8b581e878252 WHIRLPOOL 4f8a52fc682c15a96660049159e98ddd9f68170e2cba3948f73f3105a266bce8b4c42329b4dc0d6f94472fd9139bbd9a8ebbf3f7351a95c868e78999ce276ece
+DIST onig-5.9.6_p1.tar.gz 605920 SHA256 ac34ae0624296b59ff9ad9a2e93f2b1cdd775ca87057a42d27e551b7a76ff7b4 SHA512 5c874a92acab19e7b228e855cee2d8c55648d3c0c25213127e67bba7f510ec68cb5d64999cf629ffa509745e1b0bd13dd80afbdcef3ba1d4bb8f3d0ee3616f48 WHIRLPOOL be0f030469cbaef0f196190a18725eb4f516b3b78c1a3484fe602462df1ada48fa848fc59f619f0089a352293825f809034c18e5964802fc964032d94e10f03b
+DIST onig-6.4.0.tar.gz 900425 SHA256 cf43ddc5167aea260c4297c76b0dd5e1e6d67aa39319db667347d4d0706ff695 SHA512 476f2110f09eae9b27e0da4b995fa9db46fe6f98f5ef8700b9f1966f9b4bf6db680c6e9e67e1d8d81e759fd8d1787af39c4b38d6681ee4b6405a970c18d583fa WHIRLPOOL bc89b0217a89c70234d2b167fbe68e7588104c812d4df18e64964511cf764786d53a50e87561438d317f435ab30f179990202fc8892b8ab4e85d1cbf8b21c6b9
+DIST onig-6.6.1.tar.gz 943490 SHA256 8f9731f9e48666236a1678e2b4ead69be682eefba3983a714b6b57cf5ee14372 SHA512 ce9ac1336e2782fcfdac8cb4a257162f57dd8c2be20f74771a1ab9671b5926ea9c9fc07e2f4b04d80a2138a6e4c0e3295ac3f257e4424acf888e343870a377cc WHIRLPOOL c6ed29ca7b4f2ce83d4d17daf7292689b420dd5a5a82e0c1c6b2707dae5b5af4227ebcf4b495096a084c45c23b96df5c924e5cd0ea238ba5246d56d99c460cbf
+EBUILD oniguruma-5.9.5.ebuild 1129 SHA256 fe48f2becf821d0d60f91ce82a8f72260b44fd38cce6dd526e40999a89adaab7 SHA512 0889defa5f3a79337e4bd353f49d19a88870fc4657acddb88b47cc49bd2d54e64e7a10afb393a8e2b93cf196d7ff140d9117c61c7ba0551d0903bcd13703bb6b WHIRLPOOL ad4cfd96d4a9babae36ab975cf2facad5b9f240fbd67ec16ac75897b76647b5c8833a7f87e0c934115b01b6afc568985fe471d37d2f15cc7236dc6175ed7ac0f
+EBUILD oniguruma-5.9.6_p1-r1.ebuild 1379 SHA256 a484fd0dab3622ff12e0d68dc6913ac81292ba1f386970937f7da7f4856518f2 SHA512 6817357097456c702b5488cee375135e54bed44360a2edf0dbad9b2712c8c824b4f5433b73cfc8dcf460075fd95a6a396916a79032de4a69d633c856bd52fbea WHIRLPOOL fa4c0019b4692de04933e002586220cb7c3b1244d4f817fd41f503b3f09b0bb7224d3b88076802bdc4abf06e9390d24b8f9abb24e35206eeaa55da6b21c418e7
+EBUILD oniguruma-6.4.0.ebuild 1167 SHA256 1e05d4de551c9657f3a51ae130602408c256921dede9f5f6f52a69d14c70f1ed SHA512 684194ee689ad9fb79fb2c933f8eb64e8dfa20c79da0c76907cc6b913391f2e4bbd42793a4d11204c66d87651c349f71c75c4169f2ad87808b9f43b6a14b63c1 WHIRLPOOL cbb7c9eae2d7cd5d621e84d95d957b7c978554105ae15d225fb2ce2bfdcb7ed56e6adf2ec255c1730286379152f57d8ea20244cbfa8276af5925ba00e2f24811
+EBUILD oniguruma-6.6.1.ebuild 1133 SHA256 614ea746e7cc40827befd67cca7a200d573b98abfe043e2c7d064de3a039d93d SHA512 896f8090aa2f0e146e120f392a2c0b847c51dede34b2dd17760119a9d8d97c2b072b4588ea5951b27490dc3405d0ca9e7460ebbbede0cfded7c6f512f36426bf WHIRLPOOL df95199b70e0c8e380f0f5bb27faf3725fee76b4a18a4b8138a0b11aabc68eb01873dd61d1d92a9b75138c4d81970a5fb253fa009d4e3f9c4ca61bb3d10ff781
+MISC ChangeLog 3480 SHA256 017a5b8fa1c2c3efbff36f8fc86700c40dd5f6c4a5cd3111279c460f762140db SHA512 5340377126666c789a2e2445bced19c8348aca7a862da341bd950b737545824e836a567a70f0e99aa7765964eada43980ec761fc16d8868067f2ddd2beb24529 WHIRLPOOL 1f3f3aa4fd8af3724f25c24ec7a371c63b49f85b4965185d6a11a075369a50cdd5970dff0fca833ab618b178dd7bc57f9ad85e4514fbc7336a1f313d34cf4971
+MISC ChangeLog-2015 9089 SHA256 ff4e22531be2af0b4732475ca1e23fef670ee4982fa0d519d1272b98c05fffd3 SHA512 6ab9ec86d19b1644073fa2cc50414f2984c6e51f0658be44f5b2b0172a6f8cdb98aefbfa650621c03d992df3cca4c430489fc8058aa58a40332399ccadb4eb63 WHIRLPOOL 54e80067dd972b53205940d26676d010743507b7269b7470a48878b64a0975e8522551984a0eb56fe7f6bd9f344b4c597a6ae1921374b39527d53e83872f1b71
+MISC metadata.xml 898 SHA256 1dea20487ad239dacee930e91229ad7e1b49bf75597c52567cd1f670cff966f5 SHA512 d9736125e403f64018466a0fd53e19e86552254bfba410d38b7d9d485c50b74a55757de54fee90cdbaf21f6a535b5d765e38019e5fc3adbe5cb1fcf88ab71a2a WHIRLPOOL 130834b5e6ea1a6cfdc30b8e3c0cd81c9cd4bec586ee6ee1a84574e8ddff32bfb490fca959f2dfd44fd90acb5367c1d01cfd3c41f567452b8efeb0c23a197304
diff --git a/dev-libs/oniguruma/files/oniguruma-5.9.3-makefile.patch b/dev-libs/oniguruma/files/oniguruma-5.9.3-makefile.patch
new file mode 100644
index 000000000000..7003907f7850
--- /dev/null
+++ b/dev-libs/oniguruma/files/oniguruma-5.9.3-makefile.patch
@@ -0,0 +1,48 @@
+diff --git a/Makefile.am b/Makefile.am
+index 2865fb7..75cbd45 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -6,7 +6,7 @@ libname = libonig.la
+ ACLOCAL_AMFLAGS = -I m4
+ #AM_CFLAGS = -DNOT_RUBY
+ AM_CFLAGS =
+-INCLUDES = -I$(top_srcdir) -I$(includedir)
++INCLUDES = -I$(top_srcdir)
+
+ SUBDIRS = . sample
+
+diff --git a/configure.in b/configure.in
+index 1e21f96..51b56d8 100644
+--- a/configure.in
++++ b/configure.in
+@@ -25,7 +25,7 @@ dnl check for COMBINATION_EXPLOSION
+ AC_ARG_ENABLE(combination-explosion-check,
+ [ --enable-combination-explosion-check enable combination explosion check],
+ [comb_expl_check=$enableval])
+-if test "${comb_expl_check}" = yes; then
++if test "x${comb_expl_check}" = xyes; then
+ AC_DEFINE(USE_COMBINATION_EXPLOSION_CHECK,1,[Define if combination explosion check])
+ fi
+
+@@ -33,7 +33,7 @@ dnl check for CRNL_AS_LINE_TERMINATOR
+ AC_ARG_ENABLE(crnl-as-line-terminator,
+ [ --enable-crnl-as-line-terminator enable CR+NL as line terminator],
+ [crnl_as_line_terminator=$enableval])
+-if test "${crnl_as_line_terminator}" = yes; then
++if test "x${crnl_as_line_terminator}" = xyes; then
+ AC_DEFINE(USE_CRNL_AS_LINE_TERMINATOR,1,[Define if enable CR+NL as line terminator])
+ fi
+
+diff --git a/sample/Makefile.am b/sample/Makefile.am
+index af33057..347af94 100644
+--- a/sample/Makefile.am
++++ b/sample/Makefile.am
+@@ -2,7 +2,7 @@ noinst_PROGRAMS = encode listcap names posix simple sql syntax crnl
+
+ libname = $(top_builddir)/libonig.la
+ LDADD = $(libname)
+-INCLUDES = -I$(top_srcdir) -I$(includedir)
++INCLUDES = -I$(top_srcdir)
+
+ encode_SOURCES = encode.c
+ listcap_SOURCES = listcap.c
diff --git a/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9224.patch b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9224.patch
new file mode 100644
index 000000000000..b256e0df581c
--- /dev/null
+++ b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9224.patch
@@ -0,0 +1,22 @@
+https://github.com/kkos/oniguruma/issues/57
+https://github.com/kkos/oniguruma/commit/690313a061f7a4fa614ec5cc8368b4f2284e059b
+
+Author: K.Kosako <kosako@sofnec.co.jp>
+
+--- a/regexec.c
++++ b/regexec.c
+@@ -1473,14 +1473,9 @@
+ break;
+
+ case OP_EXACT1: MOP_IN(OP_EXACT1);
+-#if 0
+ DATA_ENSURE(1);
+ if (*p != *s) goto fail;
+ p++; s++;
+-#endif
+- if (*p != *s++) goto fail;
+- DATA_ENSURE(0);
+- p++;
+ MOP_OUT;
+ break;
+
diff --git a/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9226.patch b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9226.patch
new file mode 100644
index 000000000000..f5e0490ecfb8
--- /dev/null
+++ b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9226.patch
@@ -0,0 +1,39 @@
+https://github.com/kkos/oniguruma/issues/55
+https://github.com/kkos/oniguruma/commit/f015fbdd95f76438cd86366467bb2b39870dd7c6
+https://github.com/kkos/oniguruma/commit/b4bf968ad52afe14e60a2dc8a95d3555c543353a
+
+Author: K.Kosako <kosako@sofnec.co.jp>
+
+--- a/regparse.c
++++ b/regparse.c
+@@ -3064,7 +3064,7 @@
+ PUNFETCH;
+ prev = p;
+ num = scan_unsigned_octal_number(&p, end, 3, enc);
+- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
++ if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
+ if (p == prev) { /* can't read nothing. */
+ num = 0; /* but, it's not error */
+ }
+@@ -3436,7 +3436,7 @@
+ if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
+ prev = p;
+ num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);
+- if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
++ if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
+ if (p == prev) { /* can't read nothing. */
+ num = 0; /* but, it's not error */
+ }
+@@ -4084,7 +4084,12 @@
+ switch (*state) {
+ case CCS_VALUE:
+ if (*type == CCV_SB)
++ {
++ if (*vs > 0xff)
++ return ONIGERR_INVALID_CODE_POINT_VALUE;
++
+ BITSET_SET_BIT(cc->bs, (int )(*vs));
++ }
+ else if (*type == CCV_CODE_POINT) {
+ r = add_code_range(&(cc->mbuf), env, *vs, *vs);
+ if (r < 0) return r;
diff --git a/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9227.patch b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9227.patch
new file mode 100644
index 000000000000..580cc1446791
--- /dev/null
+++ b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9227.patch
@@ -0,0 +1,16 @@
+https://github.com/kkos/oniguruma/issues/58
+https://github.com/kkos/oniguruma/commit/9690d3ab1f9bcd2db8cbe1fe3ee4a5da606b8814
+
+Author: K.Kosako <kosako@sofnec.co.jp>
+
+--- a/regexec.c
++++ b/regexec.c
+@@ -3154,6 +3154,8 @@
+ }
+ else {
+ UChar *q = p + reg->dmin;
++
++ if (q >= end) return 0; /* fail */
+ while (p < q) p += enclen(reg->enc, p);
+ }
+ }
diff --git a/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9228.patch b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9228.patch
new file mode 100644
index 000000000000..523455c97f38
--- /dev/null
+++ b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9228.patch
@@ -0,0 +1,18 @@
+https://github.com/kkos/oniguruma/issues/60
+https://github.com/kkos/oniguruma/commit/3b63d12038c8d8fc278e81c942fa9bec7c704c8b
+
+Author: K.Kosako <kosako@sofnec.co.jp>
+
+--- a/regparse.c
++++ b/regparse.c
+@@ -4081,7 +4081,9 @@
+ }
+ }
+
+- *state = CCS_VALUE;
++ if (*state != CCS_START)
++ *state = CCS_VALUE;
++
+ *type = CCV_CLASS;
+ return 0;
+ }
diff --git a/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9229.patch b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9229.patch
new file mode 100644
index 000000000000..f2dbc55d59ac
--- /dev/null
+++ b/dev-libs/oniguruma/files/oniguruma-5.9.6-CVE-2017-9229.patch
@@ -0,0 +1,43 @@
+https://github.com/kkos/oniguruma/issues/59
+https://github.com/kkos/oniguruma/commit/b690371bbf97794b4a1d3f295d4fb9a8b05d402d
+
+Author: K.Kosako <kosako@sofnec.co.jp>
+
+--- a/regexec.c
++++ b/regexec.c
+@@ -3207,18 +3207,25 @@
+ }
+ else {
+ if (reg->dmax != ONIG_INFINITE_DISTANCE) {
+- *low = p - reg->dmax;
+- if (*low > s) {
+- *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
+- *low, (const UChar** )low_prev);
+- if (low_prev && IS_NULL(*low_prev))
+- *low_prev = onigenc_get_prev_char_head(reg->enc,
+- (pprev ? pprev : s), *low);
++ if (p - str < reg->dmax) {
++ *low = (UChar* )str;
++ if (low_prev)
++ *low_prev = onigenc_get_prev_char_head(reg->enc, str, *low);
+ }
+ else {
+- if (low_prev)
+- *low_prev = onigenc_get_prev_char_head(reg->enc,
+- (pprev ? pprev : str), *low);
++ *low = p - reg->dmax;
++ if (*low > s) {
++ *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
++ *low, (const UChar** )low_prev);
++ if (low_prev && IS_NULL(*low_prev))
++ *low_prev = onigenc_get_prev_char_head(reg->enc,
++ (pprev ? pprev : s), *low);
++ }
++ else {
++ if (low_prev)
++ *low_prev = onigenc_get_prev_char_head(reg->enc,
++ (pprev ? pprev : str), *low);
++ }
+ }
+ }
+ }
diff --git a/dev-libs/oniguruma/files/oniguruma-6.6.1-build.patch b/dev-libs/oniguruma/files/oniguruma-6.6.1-build.patch
new file mode 100644
index 000000000000..452347c90baf
--- /dev/null
+++ b/dev-libs/oniguruma/files/oniguruma-6.6.1-build.patch
@@ -0,0 +1,25 @@
+https://github.com/kkos/oniguruma/issues/68
+https://github.com/kkos/oniguruma/commit/1337755c2758a62057ef95f1cff1b9466f533301
+
+--- /sample/Makefile.am
++++ /sample/Makefile.am
+@@ -4,7 +4,7 @@
+ LDADD = $(lib_onig)
+
+ AM_LDFLAGS = -L$(prefix)/lib
+-AM_CPPFLAGS = -I../src -I$(includedir)
++AM_CPPFLAGS = -I$(top_srcdir)/src -I$(includedir)
+
+ TESTS = encode listcap names posix simple sql syntax user_property bug_fix
+
+--- /test/Makefile.am
++++ /test/Makefile.am
+@@ -3,7 +3,7 @@
+
+ AM_LDFLAGS = -L$(prefix)/lib
+ AM_CFLAGS =
+-AM_CPPFLAGS = -I../src -I$(includedir)
++AM_CPPFLAGS = -I$(top_srcdir)/src -I$(includedir)
+
+ TESTS = test_utf8 testc testp testcu
+
diff --git a/dev-libs/oniguruma/files/oniguruma-combination-explosion-check.patch b/dev-libs/oniguruma/files/oniguruma-combination-explosion-check.patch
new file mode 100644
index 000000000000..cfc758d2a083
--- /dev/null
+++ b/dev-libs/oniguruma/files/oniguruma-combination-explosion-check.patch
@@ -0,0 +1,13 @@
+--- a/src/regcomp.c
++++ b/src/regcomp.c
+@@ -3619,8 +3619,8 @@
+ switch (en->type) {
+ case ENCLOSURE_MEMORY:
+ {
+- if (env->curr_max_regnum < en->regnum)
+- env->curr_max_regnum = en->regnum;
++ if (env->curr_max_regnum < en->m.regnum)
++ env->curr_max_regnum = en->m.regnum;
+
+ r = setup_comb_exp_check(NODE_ENCLOSURE_BODY(en), state, env);
+ }
diff --git a/dev-libs/oniguruma/files/oniguruma-gentoo.patch b/dev-libs/oniguruma/files/oniguruma-gentoo.patch
new file mode 100644
index 000000000000..5661cea03b54
--- /dev/null
+++ b/dev-libs/oniguruma/files/oniguruma-gentoo.patch
@@ -0,0 +1,49 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -18,7 +18,7 @@
+ AC_ARG_ENABLE(combination-explosion-check,
+ [ --enable-combination-explosion-check enable combination explosion check],
+ [comb_expl_check=$enableval])
+-if test "${comb_expl_check}" = yes; then
++if test "x${comb_expl_check}" = xyes; then
+ AC_DEFINE(USE_COMBINATION_EXPLOSION_CHECK,1,[Define if combination explosion check])
+ fi
+
+@@ -26,7 +26,7 @@
+ AC_ARG_ENABLE(crnl-as-line-terminator,
+ [ --enable-crnl-as-line-terminator enable CR+NL as line terminator],
+ [crnl_as_line_terminator=$enableval])
+-if test "${crnl_as_line_terminator}" = yes; then
++if test "x${crnl_as_line_terminator}" = xyes; then
+ AC_DEFINE(USE_CRNL_AS_LINE_TERMINATOR,1,[Define if enable CR+NL as line terminator])
+ fi
+
+--- a/sample/Makefile.am
++++ b/sample/Makefile.am
+@@ -1,10 +1,10 @@
+ #noinst_PROGRAMS = encode listcap names posix simple sql syntax crnl
+
+-lib_onig = ../src/libonig.la
++lib_onig = $(top_builddir)/src/libonig.la
+ LDADD = $(lib_onig)
+
+ AM_LDFLAGS = -L$(prefix)/lib
+-AM_CPPFLAGS = -I../src -I$(includedir)
++AM_CPPFLAGS = -I$(top_srcdir)/src
+
+ TESTS = encode listcap names posix simple sql syntax user_property bug_fix
+
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -1,9 +1,9 @@
+ ## Makefile.am for Oniguruma
+-lib_onig = ../src/libonig.la
++lib_onig = $(top_builddir)/src/libonig.la
+
+ AM_LDFLAGS = -L$(prefix)/lib
+ AM_CFLAGS =
+-AM_CPPFLAGS = -I../src -I$(includedir)
++AM_CPPFLAGS = -I$(top_srcdir)/src
+
+ TESTS = testc testp testcu
+
diff --git a/dev-libs/oniguruma/metadata.xml b/dev-libs/oniguruma/metadata.xml
new file mode 100644
index 000000000000..355bf4764886
--- /dev/null
+++ b/dev-libs/oniguruma/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>cjk@gentoo.org</email>
+ <name>Cjk</name>
+ </maintainer>
+ <longdescription>
+ Oniguruma is a regular expression library. The characteristics of
+ this library is that different character encoding for every regular
+ expression object can be specified. (Supported character encodings:
+ ASCII, UTF-8, EUC-JP, Shift_JIS)
+ </longdescription>
+ <slots>
+ <subslots>Reflect ABI of libonig.so.</subslots>
+ </slots>
+ <use>
+ <flag name="combination-explosion-check">
+ enable combination explosion check
+ </flag>
+ <flag name="crnl-as-line-terminator">
+ enable CR+NL as line terminator
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="github">kkos/oniguruma</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-libs/oniguruma/oniguruma-5.9.5.ebuild b/dev-libs/oniguruma/oniguruma-5.9.5.ebuild
new file mode 100644
index 000000000000..76fc996f4d9d
--- /dev/null
+++ b/dev-libs/oniguruma/oniguruma-5.9.5.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+# Needed for a sane .so versionning on fbsd, please dont drop
+AUTOTOOLS_AUTORECONF=1
+
+inherit eutils autotools-multilib
+
+MY_P=onig-${PV}
+
+DESCRIPTION="a regular expression library for different character encodings"
+HOMEPAGE="http://www.geocities.jp/kosako3/oniguruma"
+SRC_URI="http://www.geocities.jp/kosako3/oniguruma/archive/${MY_P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="combination-explosion-check crnl-as-line-terminator static-libs"
+
+PATCHES=( "${FILESDIR}"/${PN}-5.9.3-makefile.patch )
+DOCS=( AUTHORS HISTORY README{,.ja} doc/{API,FAQ,RE}{,.ja} )
+
+S=${WORKDIR}/${MY_P}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable combination-explosion-check)
+ $(use_enable crnl-as-line-terminator)
+ )
+ autotools-multilib_src_configure
+}
+
+src_install() {
+ autotools-multilib_src_install
+ use static-libs || prune_libtool_files
+}
diff --git a/dev-libs/oniguruma/oniguruma-5.9.6_p1-r1.ebuild b/dev-libs/oniguruma/oniguruma-5.9.6_p1-r1.ebuild
new file mode 100644
index 000000000000..7fb47e7f69fc
--- /dev/null
+++ b/dev-libs/oniguruma/oniguruma-5.9.6_p1-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools ltprune multilib-minimal
+
+MY_P="onig-${PV}"
+
+DESCRIPTION="a regular expression library for different character encodings"
+HOMEPAGE="https://github.com/kkos/oniguruma"
+SRC_URI="https://github.com/kkos/${PN}/releases/download/v${PV}/${MY_P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/2" # sub-slot matches SONAME major
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="combination-explosion-check crnl-as-line-terminator static-libs"
+
+S="${WORKDIR}/${MY_P/_p1/}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.9.3-makefile.patch
+ "${FILESDIR}"/${P/_p1/}-CVE-2017-9224.patch
+ "${FILESDIR}"/${P/_p1/}-CVE-2017-9226.patch
+ "${FILESDIR}"/${P/_p1/}-CVE-2017-9227.patch
+ "${FILESDIR}"/${P/_p1/}-CVE-2017-9228.patch
+ "${FILESDIR}"/${P/_p1/}-CVE-2017-9229.patch
+)
+DOCS=( AUTHORS HISTORY README{,.ja} doc/. )
+
+src_prepare() {
+ default
+ mv configure.{in,ac} || die
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ $(use_enable combination-explosion-check) \
+ $(use_enable crnl-as-line-terminator) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ prune_libtool_files
+}
diff --git a/dev-libs/oniguruma/oniguruma-6.4.0.ebuild b/dev-libs/oniguruma/oniguruma-6.4.0.ebuild
new file mode 100644
index 000000000000..5388b8aa7c20
--- /dev/null
+++ b/dev-libs/oniguruma/oniguruma-6.4.0.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools ltprune multilib-minimal
+
+MY_P="onig-${PV}"
+
+DESCRIPTION="a regular expression library for different character encodings"
+HOMEPAGE="https://github.com/kkos/oniguruma"
+SRC_URI="https://github.com/kkos/${PN}/releases/download/v${PV}/${MY_P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/4" # sub-slot matches SONAME major
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="combination-explosion-check crnl-as-line-terminator static-libs"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-gentoo.patch
+ "${FILESDIR}"/${PN}-combination-explosion-check.patch
+)
+DOCS=( AUTHORS HISTORY README{,.ja} doc/. )
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ $(use_enable combination-explosion-check) \
+ $(use_enable crnl-as-line-terminator) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ prune_libtool_files
+}
diff --git a/dev-libs/oniguruma/oniguruma-6.6.1.ebuild b/dev-libs/oniguruma/oniguruma-6.6.1.ebuild
new file mode 100644
index 000000000000..b2c39c9f2409
--- /dev/null
+++ b/dev-libs/oniguruma/oniguruma-6.6.1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools multilib-minimal
+
+MY_P="onig-${PV}"
+
+DESCRIPTION="Regular expression library for different character encodings"
+HOMEPAGE="https://github.com/kkos/oniguruma"
+SRC_URI="https://github.com/kkos/${PN}/releases/download/v${PV}/${MY_P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0/4"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="combination-explosion-check crnl-as-line-terminator static-libs"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-build.patch"
+)
+
+DOCS=(AUTHORS HISTORY README{,_japanese} doc/{API,FAQ,RE}{,.ja} doc/UNICODE_PROPERTIES)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ $(use_enable combination-explosion-check) \
+ $(use_enable crnl-as-line-terminator) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ find "${D}" -name "*.la" -delete || die
+}