aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-11-03 07:19:16 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-11-03 07:19:16 +0000
commitf87a1529af4c850c6849a8dc86ec5ac97aa195d2 (patch)
treee93d180ba5544dcbc9c20fccdc13b4f7dc62431d
parent4ba5657398b12fa17ad53e750a42a9b67c2de8af (diff)
parent5fbbca0125074e0ceca21efd9a412566bebdf782 (diff)
downloadregex-f87a1529af4c850c6849a8dc86ec5ac97aa195d2.tar.gz
Upgrade rust/crates/regex to 1.4.2 am: 1d704cd422 am: 5fbbca0125
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/regex/+/1485296 Change-Id: I217545f31d9a05af384af68303a07e24936e24fb
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp4
-rw-r--r--CHANGELOG.md10
-rw-r--r--Cargo.toml4
-rw-r--r--Cargo.toml.orig4
-rw-r--r--METADATA8
-rw-r--r--tests/regression_fuzz.rs19
-rw-r--r--tests/test_default.rs1
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"
}
}
diff --git a/Android.bp b/Android.bp
index f2e1727..ac83b2d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -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
diff --git a/Cargo.toml b/Cargo.toml
index bc455bc..b6213ea 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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]
diff --git a/METADATA b/METADATA
index 86023f9..663a944 100644
--- a/METADATA
+++ b/METADATA
@@ -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;