diff options
author | Haibo Huang <hhb@google.com> | 2020-11-03 07:41:50 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-11-03 07:41:50 +0000 |
commit | ea0faf6bf53b8a6672c5e67fc1c45f98d1b5e25a (patch) | |
tree | e93d180ba5544dcbc9c20fccdc13b4f7dc62431d | |
parent | 910574851b504a9aff6861089887f234df2bdf88 (diff) | |
parent | f87a1529af4c850c6849a8dc86ec5ac97aa195d2 (diff) | |
download | regex-ea0faf6bf53b8a6672c5e67fc1c45f98d1b5e25a.tar.gz |
Upgrade rust/crates/regex to 1.4.2 am: 1d704cd422 am: 5fbbca0125 am: f87a1529af
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/regex/+/1485296
Change-Id: Iaf77771e27442b3efa0632458f1cda3e01c73e53
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | CHANGELOG.md | 10 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | Cargo.toml.orig | 4 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | tests/regression_fuzz.rs | 19 | ||||
-rw-r--r-- | tests/test_default.rs | 1 |
8 files changed, 41 insertions, 11 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 407f0d7..4e6ed7c 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "d5bf98f293b48174d5378471d01c2e0ef271bbbc" + "sha1": "3bcae3b6954ea3628ef0974f0a2604a6ae248408" } } @@ -36,6 +36,6 @@ rust_library_host { // dependent_library ["feature_list"] // aho-corasick-0.7.14 "default,std" // lazy_static-1.4.0 -// memchr-2.3.3 "default,std,use_std" -// regex-syntax-0.6.20 "default,unicode,unicode-age,unicode-bool,unicode-case,unicode-gencat,unicode-perl,unicode-script,unicode-segment" +// memchr-2.3.4 "default,std,use_std" +// regex-syntax-0.6.21 "default,unicode,unicode-age,unicode-bool,unicode-case,unicode-gencat,unicode-perl,unicode-script,unicode-segment" // thread_local-1.0.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 82aa089..9dfe497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +1.4.2 (2020-11-01) +================== +This is a small bug fix release that bans `\P{any}`. We previously banned empty +classes like `[^\w\W]`, but missed the `\P{any}` case. In the future, we hope +to permit empty classes. + +* [BUG #722](https://github.com/rust-lang/regex/issues/722): + Ban `\P{any}` to avoid a panic in the regex compiler. Found by OSS-Fuzz. + + 1.4.1 (2020-10-13) ================== This is a small bug fix release that makes `\p{cf}` work. Previously, it would @@ -12,7 +12,7 @@ [package] name = "regex" -version = "1.4.1" +version = "1.4.2" authors = ["The Rust Project Developers"] exclude = ["/scripts/*", "/.github/*"] autotests = false @@ -80,7 +80,7 @@ version = "2.2.1" optional = true [dependencies.regex-syntax] -version = "0.6.20" +version = "0.6.21" default-features = false [dependencies.thread_local] diff --git a/Cargo.toml.orig b/Cargo.toml.orig index fd238a9..dac60bb 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "regex" -version = "1.4.1" #:version +version = "1.4.2" #:version authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md" @@ -118,7 +118,7 @@ optional = true # For parsing regular expressions. [dependencies.regex-syntax] path = "regex-syntax" -version = "0.6.20" +version = "0.6.21" default-features = false [dev-dependencies] @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/regex/regex-1.4.1.crate" + value: "https://static.crates.io/crates/regex/regex-1.4.2.crate" } - version: "1.4.1" + version: "1.4.2" license_type: NOTICE last_upgrade_date { year: 2020 - month: 10 - day: 26 + month: 11 + day: 2 } } diff --git a/tests/regression_fuzz.rs b/tests/regression_fuzz.rs new file mode 100644 index 0000000..5f92ed0 --- /dev/null +++ b/tests/regression_fuzz.rs @@ -0,0 +1,19 @@ +// These tests are only run for the "default" test target because some of them +// can take quite a long time. Some of them take long enough that it's not +// practical to run them in debug mode. :-/ + +// See: https://oss-fuzz.com/testcase-detail/5673225499181056 +// +// Ignored by default since it takes too long in debug mode (almost a minute). +#[test] +#[ignore] +fn fuzz1() { + regex!(r"1}{55}{0}*{1}{55}{55}{5}*{1}{55}+{56}|;**"); +} + +// See: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26505 +// See: https://github.com/rust-lang/regex/issues/722 +#[test] +fn empty_any_errors_no_panic() { + assert!(regex_new!(r"\P{any}").is_err()); +} diff --git a/tests/test_default.rs b/tests/test_default.rs index c0979c1..241e580 100644 --- a/tests/test_default.rs +++ b/tests/test_default.rs @@ -49,6 +49,7 @@ mod misc; mod multiline; mod noparse; mod regression; +mod regression_fuzz; mod replace; mod searcher; mod set; |