Snap for 8564071 from 018c12887827c60b005b79ac39f26fb707c37cc5 to mainline-sdkext-release
Change-Id: I6a7c068747d77e05fecb098a6c8dbf59d07f03ce
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 9926491..0eb4358 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "5e929762c9319f4f5b8d0311c920a9069d3d2e10"
+ "sha1": "837538c549f3458f157ee154ae76e3e2b9e27118"
}
}
diff --git a/Android.bp b/Android.bp
index 8661d79..1838279 100644
--- a/Android.bp
+++ b/Android.bp
@@ -41,6 +41,8 @@
name: "libidna",
host_supported: true,
crate_name: "idna",
+ cargo_env_compat: true,
+ cargo_pkg_version: "0.2.3",
srcs: ["src/lib.rs"],
edition: "2018",
rustlibs: [
@@ -54,10 +56,3 @@
],
min_sdk_version: "29",
}
-
-// dependent_library ["feature_list"]
-// matches-0.1.8
-// tinyvec-1.2.0 "alloc,default,tinyvec_macros"
-// tinyvec_macros-0.1.0
-// unicode-bidi-0.3.5 "default"
-// unicode-normalization-0.1.17 "default,std"
diff --git a/Cargo.toml b/Cargo.toml
index 5666892..138a271 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
[package]
edition = "2018"
name = "idna"
-version = "0.2.2"
+version = "0.2.3"
authors = ["The rust-url developers"]
autotests = false
description = "IDNA (Internationalizing Domain Names in Applications) and Punycode."
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 8aba16d..6b3750b 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "idna"
-version = "0.2.2"
+version = "0.2.3"
authors = ["The rust-url developers"]
description = "IDNA (Internationalizing Domain Names in Applications) and Punycode."
repository = "https://github.com/servo/rust-url/"
diff --git a/METADATA b/METADATA
index b73f242..265ca62 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/idna/idna-0.2.2.crate"
+ value: "https://static.crates.io/crates/idna/idna-0.2.3.crate"
}
- version: "0.2.2"
+ version: "0.2.3"
license_type: NOTICE
last_upgrade_date {
year: 2021
- month: 4
- day: 1
+ month: 5
+ day: 19
}
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 5da7ae4..407ec5c 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,17 +1,21 @@
// Generated by update_crate_tests.py for tests that depend on this crate.
{
+ "imports": [
+ {
+ "path": "external/rust/crates/quiche"
+ },
+ {
+ "path": "external/rust/crates/url"
+ }
+ ],
"presubmit": [
{
- "name": "url_device_test_tests_unit"
- },
+ "name": "doh_unit_test"
+ }
+ ],
+ "presubmit-rust": [
{
- "name": "url_device_test_tests_data"
- },
- {
- "name": "url_device_test_src_lib"
- },
- {
- "name": "quiche_device_test_src_lib"
+ "name": "doh_unit_test"
}
]
}
diff --git a/src/punycode.rs b/src/punycode.rs
index a237504..21955f3 100644
--- a/src/punycode.rs
+++ b/src/punycode.rs
@@ -78,6 +78,10 @@
),
};
+ if !base.is_ascii() {
+ return Err(());
+ }
+
let base_len = base.len();
let mut length = base_len as u32;
let mut code_point = INITIAL_N;
diff --git a/src/uts46.rs b/src/uts46.rs
index 0b7d27a..ad79805 100644
--- a/src/uts46.rs
+++ b/src/uts46.rs
@@ -309,7 +309,6 @@
_ => true,
}) {
errors.invalid_mapping = true;
- return;
}
// V7: ContextJ rules
diff --git a/tests/unit.rs b/tests/unit.rs
index 84a9d54..297c8cf 100644
--- a/tests/unit.rs
+++ b/tests/unit.rs
@@ -131,3 +131,9 @@
let error = format!("{:?}", config.to_ascii("☕.com").unwrap_err());
assert!(error.contains("disallowed_in_idna_2008"));
}
+
+#[test]
+fn unicode_before_delimiter() {
+ let config = idna::Config::default();
+ assert!(config.to_ascii("xn--f\u{34a}-PTP").is_err());
+}