Dataset Viewer
Auto-converted to Parquet Duplicate
repo
string
pull_number
int64
instance_id
string
issue_numbers
sequence
base_commit
string
patch
string
test_patch
string
problem_statement
string
hints_text
string
created_at
string
version
string
updated_at
string
environment_setup_commit
string
FAIL_TO_PASS
sequence
PASS_TO_PASS
sequence
FAIL_TO_FAIL
sequence
PASS_TO_FAIL
sequence
hyperium/http
292
hyperium__http-292
[ "291" ]
4644dae042acb15d93017b69ae2ab428eb1925f7
diff --git a/src/uri/authority.rs b/src/uri/authority.rs --- a/src/uri/authority.rs +++ b/src/uri/authority.rs @@ -497,7 +497,8 @@ fn host(auth: &str) -> &str { if host_port.as_bytes()[0] == b'[' { let i = host_port.find(']') .expect("parsing should validate brackets"); - &host_port[1....
diff --git a/src/uri/tests.rs b/src/uri/tests.rs --- a/src/uri/tests.rs +++ b/src/uri/tests.rs @@ -298,7 +298,7 @@ test_parse! { scheme_part = part!("http"), authority_part = part!("[2001:0db8:85a3:0000:0000:8a2e:0370:7334]"), - host = Some("2001:0db8:85a3:0000:0000:8a2e:0370:7334"), + host = Some("[2...
Uri::host with an IPv6 returns the IP without brackets The host part of a URI with an IPv6 authority should include the brackets. ```rust let uri = "http://[::1]/".parse::<Uri>().unwrap(); ``` **Expected**: ```rust assert_eq!(uri.host(), Some("[::1]")); ``` **Actual**: ```rust assert_eq!(uri.host(),...
2019-01-23T03:00:37Z
0.1
2019-01-22T19:22:19Z
4a5b64d22a2db9e2a4de112cef5b93372b8ac5ed
[ "uri::tests::test_ipv6", "uri::tests::test_ipv6_shorthand2", "uri::tests::test_ipv6_shorthand", "uri::tests::test_ipv6_shorthand3", "uri::tests::test_ipv6_with_port" ]
[ "header::map::test_bounds", "extensions::test_extensions", "header::map::skip_duplicates_during_key_iteration", "header::name::tests::test_bounds", "header::name::tests::test_eq_hdr_name", "header::name::tests::test_from_hdr_name", "header::name::tests::test_from_static_custom_long", "header::name::te...
[]
[]
hyperium/http
262
hyperium__http-262
[ "260" ]
f8b369330550006d7fdeac35def76038e8da5cd3
diff --git a/src/method.rs b/src/method.rs --- a/src/method.rs +++ b/src/method.rs @@ -143,6 +143,9 @@ impl Method { /// Converts a slice of bytes to an HTTP method. pub fn from_bytes(src: &[u8]) -> Result<Method, InvalidMethod> { match src.len() { + 0 => { + Err(InvalidMeth...
diff --git a/src/method.rs b/src/method.rs --- a/src/method.rs +++ b/src/method.rs @@ -411,3 +414,9 @@ fn test_method_eq() { assert_eq!(&Method::GET, Method::GET); assert_eq!(Method::GET, &Method::GET); } + +#[test] +fn test_invalid_method() { + assert!(Method::from_str("").is_err()); + assert!(Method:...
Empty Method from string is allowed Hello, After some tests it seems that `Method::from_str("")` returns `Ok`. Shouldn't it be an error of type `InvalidMethod`? The following test fail : ``` #[test] fn it_should_return_an_invalid_method_error() { assert!(Method::from_str("").is_err()); } ```
This does not seem correct! Would you mind providing a PR to fix this 👍 Yes, I will take a look 👍
2018-10-18T22:54:29Z
0.1
2018-10-18T17:42:33Z
4a5b64d22a2db9e2a4de112cef5b93372b8ac5ed
[ "method::test_invalid_method" ]
[ "extensions::test_extensions", "header::map::test_bounds", "header::name::tests::test_bounds", "header::name::tests::test_from_hdr_name", "header::name::tests::test_eq_hdr_name", "header::name::tests::test_from_static_custom_long", "header::map::skip_duplicates_during_key_iteration", "header::name::te...
[]
[]
hyperium/http
248
hyperium__http-248
[ "243" ]
abefa3c8e7ea4995427b880bd4abe0342f4f285a
diff --git a/src/uri/authority.rs b/src/uri/authority.rs --- a/src/uri/authority.rs +++ b/src/uri/authority.rs @@ -91,6 +91,7 @@ impl Authority { let mut start_bracket = false; let mut end_bracket = false; let mut end = s.len(); + let mut at_sign_pos = None; for (i, &b) in s...
diff --git a/src/uri/tests.rs b/src/uri/tests.rs --- a/src/uri/tests.rs +++ b/src/uri/tests.rs @@ -394,6 +394,8 @@ fn test_uri_parse_error() { err("http://[::1"); err("http://::1]"); err("localhost:8080:3030"); + err("@"); + err("http://username:password@/wut"); // illegal queries err("...
Getting the host from an URI may panic, which is not stated in the documentation Getting the host from an URI may lead to a panic on some ill-formed URIs. This is not stated in the documentation, so I am guessing it is not intended. For example, this code panics: ``` extern crate http; use std::str::FromStr; ...
Calling `host()` should never panic, so that's a bug. I don't know yet whether that is separate, but parsing just `@` probably should return an error...
2018-09-12T03:05:35Z
0.1
2018-09-11T19:31:04Z
4a5b64d22a2db9e2a4de112cef5b93372b8ac5ed
[ "uri::tests::test_uri_parse_error" ]
[ "header::map::test_bounds", "extensions::test_extensions", "header::map::skip_duplicates_during_key_iteration", "header::name::tests::test_eq_hdr_name", "header::name::tests::test_bounds", "header::name::tests::test_from_hdr_name", "header::name::tests::test_from_static_custom_long", "header::name::te...
[]
[]
hyperium/http
220
hyperium__http-220
[ "197" ]
a7f3dfc5b7958c35e77a68dd2ba7461251578efa
diff --git a/src/uri/mod.rs b/src/uri/mod.rs --- a/src/uri/mod.rs +++ b/src/uri/mod.rs @@ -269,8 +269,7 @@ impl Uri { return Ok(Uri { scheme: Scheme::empty(), authority: authority, - // TODO: Should this be emp...
diff --git a/src/uri/tests.rs b/src/uri/tests.rs --- a/src/uri/tests.rs +++ b/src/uri/tests.rs @@ -26,12 +26,17 @@ macro_rules! test_parse { ) => ( #[test] fn $test_name() { - let uri = Uri::from_str($str).unwrap(); + let orig_str = $str; + let uri = Uri::from_str...
Panic in Uri::from_str(&Uri::from_str(x).to_string()) found by fuzzer In <https://github.com/rust-fuzz/targets/pull/113>, I added some simple fuzzers for parts of this crate. To test `Uri::from_str`, I added this code: ```rust pub fn fuzz_http_uri(data: &[u8]) { use std::str; use std::str::FromStr; ...
This probably a correct assertion, since it's just check that a new `Uri` can be parsed from `uri.to_string()`, which should likely be the case. I *bet* the error is that an incorrect insertion of a path, meaning it went `"S"` -> `"S/"`, and then the second parse fails. That's because the first time, it just saw the...
2018-06-23T09:08:58Z
0.1
2018-06-23T01:20:01Z
4a5b64d22a2db9e2a4de112cef5b93372b8ac5ed
[ "uri::tests::test_uri_authority_only_one_character_issue_197" ]
[ "header::map::test_bounds", "extensions::test_extensions", "header::map::skip_duplicates_during_key_iteration", "header::name::tests::test_eq_hdr_name", "header::name::tests::test_bounds", "header::name::tests::test_from_hdr_name", "header::name::tests::test_from_static_custom_single_char", "header::n...
[]
[]
hyperium/http
445
hyperium__http-445
[ "435" ]
b00473c3ec942c03de55e47af1070b16a9dd23d8
diff --git a/src/uri/authority.rs b/src/uri/authority.rs --- a/src/uri/authority.rs +++ b/src/uri/authority.rs @@ -50,7 +50,6 @@ impl Authority { .expect("static str is not valid authority") } - /// Attempt to convert a `Bytes` buffer to a `Authority`. /// /// This will try to prevent...
diff --git a/src/uri/authority.rs b/src/uri/authority.rs --- a/src/uri/authority.rs +++ b/src/uri/authority.rs @@ -642,4 +644,10 @@ mod tests { .unwrap_err(); assert_eq!(err.0, ErrorKind::InvalidUriChar); } + + #[test] + fn rejects_invalid_use_of_brackets() { + let err = Authorit...
Unexpected panic for malformed URI with brackets Doing some fuzzing I encountered this: ``` let uri = "http://[]@["; let uri = uri.parse::<http::Uri>().unwrap(); // is ok uri.host(); // panics ``` The panic is `parsing should validate brackets` and come from here: https://github.com/hyperium/http/...
Yep, this looks wrong. Thanks for reporting!
2020-11-22T20:06:37Z
0.2
2020-12-09T21:17:55Z
b00473c3ec942c03de55e47af1070b16a9dd23d8
[ "uri::authority::tests::rejects_invalid_use_of_brackets" ]
[ "error::tests::inner_error_is_invalid_status_code", "header::map::test_bounds", "extensions::test_extensions", "header::map::skip_duplicates_during_key_iteration", "header::name::tests::test_bounds", "header::name::tests::test_all_tokens", "header::name::tests::test_eq_hdr_name", "header::name::test_p...
[]
[]
hyperium/http
360
hyperium__http-360
[ "352" ]
32f1ae19f1d26c815cc935b742a94996f5a8a9bd
diff --git a/src/header/map.rs b/src/header/map.rs --- a/src/header/map.rs +++ b/src/header/map.rs @@ -638,6 +638,8 @@ impl<T> HeaderMap<T> { if cap > self.indices.len() { let cap = cap.next_power_of_two(); + assert!(cap < MAX_SIZE, "header map reserve over max capacity"); + ...
diff --git a/tests/header_map.rs b/tests/header_map.rs --- a/tests/header_map.rs +++ b/tests/header_map.rs @@ -37,6 +37,22 @@ fn smoke() { } } +#[test] +#[should_panic] +fn reserve_over_capacity() { + // See https://github.com/hyperium/http/issues/352 + let mut headers = HeaderMap::<u32>::with_capacity(32...
Size issue in `HeaderMap::reserve()` https://github.com/hyperium/http/blob/9c05e391e00474abaa8c14a86bcb0fc5eff1120e/src/header/map.rs#L622-L640 [`usize::next_power_of_two()`](https://doc.rust-lang.org/std/primitive.usize.html#method.next_power_of_two) method silently overflows to 0 in release mode. This makes it pos...
@Qwaz Am I correct that the potential vulnerability this presents is that an attacker could cause a denial of service by sending a request which causes this overflow? @hawkw An attacker can trigger a DoS if they can call `HeaderMap::reserve()` to non-empty `HeaderMap` with a controlled parameter. I believe this scenari...
2019-11-26T07:54:31Z
0.1
2019-11-26T00:30:19Z
4a5b64d22a2db9e2a4de112cef5b93372b8ac5ed
[ "reserve_over_capacity" ]
[ "error::tests::inner_error_is_invalid_status_code", "header::map::test_bounds", "extensions::test_extensions", "header::map::skip_duplicates_during_key_iteration", "header::name::tests::test_bounds", "header::name::tests::test_eq_hdr_name", "header::name::tests::test_all_tokens", "header::name::tests:...
[]
[]
hyperium/http
343
hyperium__http-343
[ "322" ]
78058fdd94f209304660f17c067bf30f253df298
diff --git a/src/uri/authority.rs b/src/uri/authority.rs --- a/src/uri/authority.rs +++ b/src/uri/authority.rs @@ -103,15 +103,20 @@ impl Authority { } b':' => { colon_cnt += 1; - }, + } b'[' => { ...
diff --git a/src/uri/authority.rs b/src/uri/authority.rs --- a/src/uri/authority.rs +++ b/src/uri/authority.rs @@ -612,4 +620,20 @@ mod tests { let err = Authority::parse_non_empty(b"a%2f:b%2f@example%2f.com").unwrap_err(); assert_eq!(err.0, ErrorKind::InvalidAuthority); } + + #[test] + fn ...
Zones in link-local IPv6 addresses seems to be not supported. ```rust extern crate http; fn main() { use http::uri::Uri; use std::str::FromStr; Uri::from_str("http://[fe80::1%25eth0]:8080/").unwrap(); } ``` `InvalidUri(InvalidAuthority)`. It parses if I omit the zone index (`%25eth0`), but su...
For what it's worth, `SocketAddr::parse` does not handle this address either: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ac423a008035b1e29562123d416fa551 Yet there is `scope_id` in `SockAddrV6`, an `u32` field. Filling it in from `parse` requires querying network interfaces information i...
2019-09-12T04:14:14Z
0.1
2019-10-07T20:04:52Z
4a5b64d22a2db9e2a4de112cef5b93372b8ac5ed
[ "uri::authority::tests::allows_percent_in_ipv6_address" ]
[ "error::tests::inner_error_is_invalid_status_code", "extensions::test_extensions", "header::map::test_bounds", "header::map::skip_duplicates_during_key_iteration", "header::name::tests::test_bounds", "header::name::tests::test_eq_hdr_name", "header::name::tests::test_all_tokens", "header::name::tests:...
[]
[]
unicode-org/icu4x
3,874
unicode-org__icu4x-3874
[ "4409" ]
aadc9be000b46edfca903560b546104498d5483b
diff --git a/components/locid_transform/src/expander.rs b/components/locid_transform/src/expander.rs --- a/components/locid_transform/src/expander.rs +++ b/components/locid_transform/src/expander.rs @@ -353,6 +353,9 @@ impl LocaleExpander { /// returns [`TransformResult::Unmodified`] and the locale argument is ...
diff --git a/components/locid_transform/tests/fixtures/maximize.json b/components/locid_transform/tests/fixtures/maximize.json --- a/components/locid_transform/tests/fixtures/maximize.json +++ b/components/locid_transform/tests/fixtures/maximize.json @@ -175,8 +175,40 @@ "input": "zh-hant-u-nu-Chinese-hc-h24", ...
Add error case to TransformResult UTS 35 specifies an error case in the likely subtags algorithm. It says that the error case can be returned in a way conventional in the programming language. I propose adding it to the TransformResult enum: ``` #[allow(clippy::exhaustive_enums)] pub enum TransformResult { //...
2023-08-16T07:31:40Z
1.4
2023-12-05T21:33:16Z
5bbfdf215bb4aa46a236a7317e38bfe2f92205ac
[ "test_maximize" ]
[ "canonicalizer::test_uts35_rule_matches", "canonicalizer::test_uts35_replacement", "expander::tests::test_new_keys", "expander::tests::test_new_small_keys", "expander::tests::test_no_keys", "fallback::algorithms::tests::test_fallback", "expander::tests::test_mixed_keys", "expander::tests::test_old_key...
[]
[]
unicode-org/icu4x
4,796
unicode-org__icu4x-4796
[ "4713" ]
75cb5b6d114f116894ec4448fe7b7a8f62909876
"diff --git a/components/calendar/src/persian.rs b/components/calendar/src/persian.rs\n--- a/compone(...TRUNCATED)
"diff --git a/components/calendar/src/persian.rs b/components/calendar/src/persian.rs\n--- a/compone(...TRUNCATED)
"Persian calendar conversion uses wrong algorithm\nLooking at https://github.com/unicode-org/icu4x/b(...TRUNCATED)
"Thank you @roozbehp for highlighting this.\r\n\r\nAs you noted, Calendrical Calculations specifies (...TRUNCATED)
2024-04-11T15:21:14Z
1.4
2024-04-15T03:35:00Z
5bbfdf215bb4aa46a236a7317e38bfe2f92205ac
["persian::tests::test_fixed_from_persian","persian::tests::test_persian_from_fixed","persian::tests(...TRUNCATED)
["buddhist::test::test_buddhist_cases_near_rd_zero","buddhist::test::test_buddhist_cases_near_epoch"(...TRUNCATED)
[]
[]
unicode-org/icu4x
4,533
unicode-org__icu4x-4533
[ "4488" ]
a917d38e90c5fdea62397da64d7b3bf5c2fa09da
"diff --git a/CHANGELOG.md b/CHANGELOG.md\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -21,6 +21,7 @@(...TRUNCATED)
"diff --git a/provider/datagen/src/driver.rs b/provider/datagen/src/driver.rs\n--- a/provider/datage(...TRUNCATED)
"Auxiliary keys don't work with hybrid or preresolved fallback\nThe way datagen works with hybrid an(...TRUNCATED)
2024-01-20T12:55:46Z
1.4
2024-01-31T16:24:32Z
5bbfdf215bb4aa46a236a7317e38bfe2f92205ac
[ "explicit_preresolved", "explicit_hybrid", "explicit_runtime" ]
["registry::test_paths_correct","transform::cldr::characters::tests::test_parse_consecutive_punct_ch(...TRUNCATED)
[ "provider/datagen/src/baked_exporter.rs - baked_exporter (line 13)" ]
[]
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
3