Skip to content

Commit 5748cec

Browse files
committed
Upgrade oniguruma lib to 6.9.3
1 parent e2b6079 commit 5748cec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+14755
-10866
lines changed

ext/mbstring/oniguruma/COPYING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Oniguruma LICENSE
22
-----------------
33

4-
Copyright (c) 2002-2018 K.Kosako <kkosako0@gmail.com>
4+
Copyright (c) 2002-2019 K.Kosako <kkosako0@gmail.com>
55
All rights reserved.
66

77
Redistribution and use in source and binary forms, with or without

ext/mbstring/oniguruma/HISTORY

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
History
22

3+
2019/08/06: Version 6.9.3 (secirity fix release)
4+
5+
2019/07/30: add ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE
6+
2019/07/29: add STK_PREC_READ_START/END stack type
7+
2019/07/29: Fix #147: Stack Exhaustion Problem caused by some parsing functions
8+
2019/07/11: add a dictionary file for libfuzzer
9+
2019/07/07: add harnesses directory
10+
2019/07/05-2019/07/29: fix many problems found by libfuzzer programs
11+
2019/06/27: deprecate onig_new_deluxe()
12+
2019/06/27: Fix CVE-2019-13224: don't allow different encodings for onig_new_deluxe()
13+
2019/06/27: Fix CVE-2019-13225: problem in converting if-then-else pattern
14+
15+
2019/05/07: Version 6.9.2 (same as Release Candidate 3)
16+
17+
2019/04/23: Release Candidate 3 for 6.9.2
18+
2019/04/23: add doc/SYNTAX.md into distribution file
19+
2019/04/09: Release Candidate 2 for 6.9.2
20+
2019/04/09: fix #139: UAF in match_at()
21+
2019/04/01: Release Candidate 1 for 6.9.2
22+
2019/04/01: update Unicode version to 12.1.0 (draft)
23+
2019/03/29: allow {n,m} (n>m) as possessive interval
24+
2019/03/25: add ONIG_SYN_OP2_OPTION_ONIGURUMA
25+
2019/03/22: add new options ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER and
26+
ONIG_OPTION_TEXT_SEGMENT_WORD
27+
2019/03/21: PR #137: fix cross-compilation
28+
2019/03/20: update Unicode version to 12.0.0
29+
2019/03/17: add doc/SYNTAX.md
30+
2019/03/13: {n,m}+ and {n,m}? are possessive and reluctant range operator
31+
in Perl syntax
32+
2019/03/04: fix #132: don't execute testp if ENABLE_POSIX_API == no
33+
2019/02/28: re-implement bytecode by using Operation struct
34+
2019/02/26: fix #130: Build error on UWP with VS2017
35+
2019/02/03: PR #128: regerror/toascii: do not attempt to serialize NULL pointer
36+
2019/01/30: Build breaks without autoreconf #73
37+
2019/01/02: fix #127: Windows VS 2008 build errors
38+
2018/12/19: fix #126: Unable to compile when USE_CALLOUT is not defined
39+
340
2018/12/11: Version 6.9.1
441

542
2018/10/08: use ENC_FLAG_SKIP_OFFSET_XXX values

ext/mbstring/oniguruma/README.md

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,58 @@ Supported character encodings:
2424

2525
* GB18030: contributed by KUBO Takehiro
2626
* CP1251: contributed by Byte
27+
* doc/SYNTAX.md: contributed by seanofw
2728

2829

29-
New feature of version 6.9.1
30-
--------------------------
30+
Version 6.9.3 (security fix release)
31+
------------------------------------
32+
33+
* Fixed CVE-2019-13224
34+
* Fixed CVE-2019-13225
35+
* Fixed many problems (found by libfuzzer programs)
36+
37+
38+
Version 6.9.2 (Reiwa)
39+
---------------------
40+
41+
* add doc/SYNTAX.md
42+
* Update Unicode version 12.1.0
43+
* NEW: Unicode Text Segment mode option (?y{g}) (?y{w}) (*original)
44+
45+
g: Extended Grapheme Cluster mode / w: Word mode
46+
47+
(Unicode Standard Annex #29 [http://unicode.org/reports/tr29/])
48+
49+
50+
Version 6.9.1
51+
-------------
3152

3253
* Speed improvement (* especially UTF-8)
3354

3455

35-
New feature of version 6.9.0
36-
--------------------------
56+
Version 6.9.0
57+
-------------
3758

3859
* Update Unicode version 11.0.0
3960
* NEW: add Emoji properties
4061

4162

42-
New feature of version 6.8.2
43-
--------------------------
63+
Version 6.8.2
64+
-------------
4465

4566
* Fix: #80 UChar in header causes issue
4667
* NEW API: onig_set_callout_user_data_of_match_param() (* omission in 6.8.0)
4768
* add doc/CALLOUTS.API and doc/CALLOUTS.API.ja
4869

4970

50-
New feature of version 6.8.1
51-
--------------------------
71+
Version 6.8.1
72+
-------------
5273

5374
* Update shared library version to 5.0.0 for API incompatible changes from 6.7.1
5475

5576

56-
New feature of version 6.8.0
57-
--------------------------
77+
Version 6.8.0
78+
-------------
5879

5980
* Retry-limit-in-match function enabled by default
6081
* NEW: configure option --enable-posix-api=no (* enabled by default)
@@ -65,32 +86,32 @@ New feature of version 6.8.0
6586
* Examples of Callouts program: [callout.c](sample/callout.c), [count.c](sample/count.c), [echo.c](sample/echo.c)
6687

6788

68-
New feature of version 6.7.1
69-
--------------------------
89+
Version 6.7.1
90+
-------------
7091

7192
* NEW: Mechanism of retry-limit-in-match (* disabled by default)
7293

7394

74-
New feature of version 6.7.0
75-
--------------------------
95+
Version 6.7.0
96+
-------------
7697

7798
* NEW: hexadecimal codepoint \uHHHH
7899
* NEW: add ONIG_SYNTAX_ONIGURUMA (== ONIG_SYNTAX_DEFAULT)
79100
* Disabled \N and \O on ONIG_SYNTAX_RUBY
80101
* Reduced size of object file
81102

82103

83-
New feature of version 6.6.0
84-
--------------------------
104+
Version 6.6.0
105+
-------------
85106

86107
* NEW: ASCII only mode options for character type/property (?WDSP)
87-
* NEW: Extended Grapheme Cluster boundary \y, \Y (*original)
108+
* NEW: Extended Grapheme Cluster boundary \y, \Y
88109
* NEW: Extended Grapheme Cluster \X
89110
* Range-clear (Absent-clear) operator restores previous range in retractions.
90111

91112

92-
New feature of version 6.5.0
93-
--------------------------
113+
Version 6.5.0
114+
-------------
94115

95116
* NEW: \K (keep)
96117
* NEW: \R (general newline) \N (no newline)
@@ -102,16 +123,16 @@ New feature of version 6.5.0
102123
* NEW: Absent stopper (?~|absent) (*original)
103124

104125

105-
New feature of version 6.4.0
106-
--------------------------
126+
Version 6.4.0
127+
-------------
107128

108129
* Fix fatal problem of endless repeat on Windows
109130
* NEW: call zero (call the total regexp) \g<0>
110131
* NEW: relative backref/call by positive number \k<+n>, \g<+n>
111132

112133

113-
New feature of version 6.3.0
114-
--------------------------
134+
Version 6.3.0
135+
-------------
115136

116137
* NEW: octal codepoint \o{.....}
117138
* Fixed CVE-2017-9224
@@ -122,20 +143,20 @@ New feature of version 6.3.0
122143
* Fixed CVE-2017-9229
123144

124145

125-
New feature of version 6.1.2
126-
--------------------------
146+
Version 6.1.2
147+
-------------
127148

128149
* allow word bound, word begin and word end in look-behind.
129150
* NEW option: ONIG_OPTION_CHECK_VALIDITY_OF_STRING
130151

131-
New feature of version 6.1
132-
--------------------------
152+
Version 6.1
153+
-----------
133154

134155
* improved doc/RE
135156
* NEW API: onig_scan()
136157

137-
New feature of version 6.0
138-
--------------------------
158+
Version 6.0
159+
-----------
139160

140161
* Update Unicode 8.0 Property/Case-folding
141162
* NEW API: onig_unicode_define_user_property()

ext/mbstring/oniguruma/doc/API

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Oniguruma API Version 6.8.0 2018/03/13
1+
Oniguruma API Version 6.9.3 2019/07/06
22

33
#include <oniguruma.h>
44

@@ -92,6 +92,8 @@ Oniguruma API Version 6.8.0 2018/03/13
9292
(alnum, alpha, blank, cntrl, digit, graph,
9393
lower, print, punct, space, upper, xdigit,
9494
word)
95+
ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER Extended Grapheme Cluster mode
96+
ONIG_OPTION_TEXT_SEGMENT_WORD Word mode
9597

9698
5 enc: character encoding.
9799

@@ -166,6 +168,9 @@ Oniguruma API Version 6.8.0 2018/03/13
166168
# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
167169
OnigCompileInfo* ci, OnigErrorInfo* einfo)
168170

171+
This function is deprecate, and it does not allow the case where
172+
the encoding of pattern and target is different.
173+
169174
Create a regex object.
170175
This function is deluxe version of onig_new().
171176

@@ -297,6 +302,7 @@ Oniguruma API Version 6.8.0 2018/03/13
297302
const UChar* range, OnigRegion* region, OnigOptionType option)
298303

299304
Search string and return search result and matching region.
305+
Do not pass invalid byte string in the regex character encoding.
300306

301307
normal return: match position offset (i.e. p - str >= 0)
302308
not found: ONIG_MISMATCH (< 0)
@@ -321,15 +327,19 @@ Oniguruma API Version 6.8.0 2018/03/13
321327
const UChar* start, const UChar* range, OnigRegion* region,
322328
OnigOptionType option, OnigMatchParam* mp)
323329

324-
arguments
325-
1-7: same as onig_search()
326-
8 mp: match parameter values (match_stack_limit, retry_limit_in_match)
330+
Search string and return search result and matching region.
331+
Do not pass invalid byte string in the regex character encoding.
332+
333+
arguments
334+
1-7: same as onig_search()
335+
8 mp: match parameter values (match_stack_limit, retry_limit_in_match)
327336

328337

329338
# int onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at,
330339
OnigRegion* region, OnigOptionType option)
331340

332341
Match string and return result and matching region.
342+
Do not pass invalid byte string in the regex character encoding.
333343

334344
normal return: match length (>= 0)
335345
not match: ONIG_MISMATCH ( < 0)
@@ -351,6 +361,9 @@ Oniguruma API Version 6.8.0 2018/03/13
351361
const UChar* at, OnigRegion* region,
352362
OnigOptionType option, OnigMatchParam* mp)
353363

364+
Match string and return result and matching region.
365+
Do not pass invalid byte string in the regex character encoding.
366+
354367
arguments
355368
1-6: same as onig_match()
356369
7 mp: match parameter values (match_stack_limit, retry_limit_in_match)
@@ -362,6 +375,7 @@ Oniguruma API Version 6.8.0 2018/03/13
362375
void* callback_arg)
363376

364377
Scan string and callback with matching region.
378+
Do not pass invalid byte string in the regex character encoding.
365379

366380
normal return: number of matching times
367381
error: error code
@@ -609,14 +623,20 @@ Oniguruma API Version 6.8.0 2018/03/13
609623

610624

611625
# int onigenc_strlen(OnigEncoding enc, const UChar* s, const UChar* end)
626+
627+
Return number of characters in the string.
628+
629+
612630
# int onigenc_strlen_null(OnigEncoding enc, const UChar* s)
613631

614632
Return number of characters in the string.
633+
Do not pass invalid byte string in the character encoding.
615634

616635

617636
# int onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s)
618637

619638
Return number of bytes in the string.
639+
Do not pass invalid byte string in the character encoding.
620640

621641

622642
# int onig_set_default_syntax(OnigSyntaxType* syntax)

ext/mbstring/oniguruma/doc/API.ja

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
鬼車インターフェース Version 6.8.0 2018/03/13
1+
鬼車インターフェース Version 6.9.3 2019/07/06
22

33
#include <oniguruma.h>
44

@@ -91,6 +91,8 @@
9191
(alnum, alpha, blank, cntrl, digit, graph,
9292
lower, print, punct, space, upper, xdigit,
9393
word)
94+
ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER 拡張書記素房モード
95+
ONIG_OPTION_TEXT_SEGMENT_WORD 単語モード
9496

9597
5 enc: 文字エンコーディング
9698

@@ -165,6 +167,9 @@
165167
# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
166168
OnigCompileInfo* ci, OnigErrorInfo* einfo)
167169

170+
この関数は廃止予定。
171+
パターンと対象文字列の文字エンコーディングが異なる場合を許さなくなった。
172+
168173
正規表現オブジェクト(regex)を作成する。
169174
この関数は、onig_new()のデラックス版。
170175

@@ -296,6 +301,7 @@
296301
const UChar* range, OnigRegion* region, OnigOptionType option)
297302

298303
正規表現で文字列を検索し、検索結果とマッチ領域を返す。
304+
正規表現オブジェクトの文字エンコーディングで、検索文字列として不正な文字列を渡してはいけない。
299305

300306
正常終了戻り値: マッチ位置 (p - str >= 0)
301307
検索失敗: ONIG_MISMATCH (< 0)
@@ -320,15 +326,19 @@
320326
const UChar* start, const UChar* range, OnigRegion* region,
321327
OnigOptionType option, OnigMatchParam* mp)
322328

329+
正規表現で文字列を検索し、検索結果とマッチ領域を返す。
330+
正規表現オブジェクトの文字エンコーディングで、検索文字列として不正な文字列を渡してはいけない。
331+
323332
引数
324333
1-7: onig_search()と同じ
325334
8 mp: マッチパラメタ値 (match_stack_limit, retry_limit_in_match)
326335

327336

328-
# int onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at,
329-
OnigRegion* region, OnigOptionType option)
337+
# int onig_match(regex_t* reg, const UChar* str, const UChar* end,
338+
const UChar* at, OnigRegion* region, OnigOptionType option)
330339

331340
文字列の指定位置でマッチングを行い、結果とマッチ領域を返す。
341+
正規表現オブジェクトの文字エンコーディングで、検索文字列として不正な文字列を渡してはいけない。
332342

333343
正常終了戻り値: マッチしたバイト長 (>= 0)
334344
not match: ONIG_MISMATCH ( < 0)
@@ -350,6 +360,9 @@
350360
const UChar* at, OnigRegion* region,
351361
OnigOptionType option, OnigMatchParam* mp)
352362

363+
文字列の指定位置でマッチングを行い、結果とマッチ領域を返す。
364+
正規表現オブジェクトの文字エンコーディングで、検索文字列として不正な文字列を渡してはいけない。
365+
353366
引数
354367
1-6: onig_match()と同じ
355368
7 mp: マッチパラメタ値 (match_stack_limit, retry_limit_in_match)
@@ -361,6 +374,7 @@
361374
void* callback_arg)
362375

363376
正規表現で文字列をスキャンして、マッチングする毎にコールバック関数を呼び出す。
377+
正規表現オブジェクトの文字エンコーディングで、検索文字列として不正な文字列を渡してはいけない。
364378

365379
正常終了: マッチ回数 (0回も含める)
366380
エラー: エラーコード (< 0)
@@ -614,14 +628,20 @@
614628

615629

616630
# int onigenc_strlen(OnigEncoding enc, const UChar* s, const UChar* end)
631+
632+
文字列の文字数を返す。
633+
634+
617635
# int onigenc_strlen_null(OnigEncoding enc, const UChar* s)
618636

619637
文字列の文字数を返す。
638+
文字エンコーディングに対して、不正な文字列を渡してはいけない。
620639

621640

622641
# int onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s)
623642

624643
文字列のバイト数を返す。
644+
文字エンコーディングに対して、不正な文字列を渡してはいけない。
625645

626646

627647
# int onig_set_default_syntax(OnigSyntaxType* syntax)

0 commit comments

Comments
 (0)