diff options
author | Joel Galenson <jgalenson@google.com> | 2021-05-25 13:19:47 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-05-25 13:19:47 +0000 |
commit | 3aa70384fb193f56c42e3e03aa7064b07f65c2df (patch) | |
tree | 7dcaf56e0a0ab243a947185dee727685cc1432d2 | |
parent | 0a01c5a1c8004e92806fbfcaf613478049645b1b (diff) | |
parent | 0582a09a9f1904da3c5a180cc7b80580872c73be (diff) | |
download | idna-android-s-beta-5.tar.gz |
Upgrade rust/crates/idna to 0.2.3 am: 0582a09a9fandroid-s-beta-5android-s-beta-4android-s-beta-3android-s-beta-5android-s-beta-4
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/idna/+/1712593
Change-Id: Ifc382b42eb5e2329ae86c54508cc1db90d23bdba
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | TEST_MAPPING | 9 | ||||
-rw-r--r-- | src/punycode.rs | 4 | ||||
-rw-r--r-- | src/uts46.rs | 1 | ||||
-rw-r--r-- | tests/unit.rs | 6 |
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" } } @@ -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/" @@ -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()); +} |