summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-05-25 13:19:47 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-05-25 13:19:47 +0000
commit3aa70384fb193f56c42e3e03aa7064b07f65c2df (patch)
tree7dcaf56e0a0ab243a947185dee727685cc1432d2
parent0a01c5a1c8004e92806fbfcaf613478049645b1b (diff)
parent0582a09a9f1904da3c5a180cc7b80580872c73be (diff)
downloadidna-android-s-beta-5.tar.gz
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/idna/+/1712593 Change-Id: Ifc382b42eb5e2329ae86c54508cc1db90d23bdba
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA8
-rw-r--r--TEST_MAPPING9
-rw-r--r--src/punycode.rs4
-rw-r--r--src/uts46.rs1
-rw-r--r--tests/unit.rs6
8 files changed, 23 insertions, 11 deletions
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/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 @@ third_party {
}
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..be39865 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,16 +2,19 @@
{
"presubmit": [
{
- "name": "url_device_test_tests_unit"
+ "name": "doh_unit_test"
},
{
- "name": "url_device_test_tests_data"
+ "name": "quiche_device_test_src_lib"
},
{
"name": "url_device_test_src_lib"
},
{
- "name": "quiche_device_test_src_lib"
+ "name": "url_device_test_tests_data"
+ },
+ {
+ "name": "url_device_test_tests_unit"
}
]
}
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 @@ impl Decoder {
),
};
+ 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 @@ fn check_validity(label: &str, config: Config, errors: &mut Errors) {
_ => 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 @@ fn emoji_domains() {
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());
+}