open-standards/wai/http-conformance/falsify/dash-run-end-unchecked.patch

15 lines
892 B
Diff
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# must fail: dash_adjacency_r_end_past_u64
# a run whose end passes 2^64 - 1 read (dash_read::timeline_of)
diff --git a/wai/wai-rs/src/http_binding/dash_read.rs b/wai/wai-rs/src/http_binding/dash_read.rs
index 71e36cde..5b55d5a1 100644
--- a/wai/wai-rs/src/http_binding/dash_read.rs
+++ b/wai/wai-rs/src/http_binding/dash_read.rs
@@ -409,7 +409,7 @@ fn timeline_of(e: &Element, inherited: &[&Element]) -> Result<Option<Timeline>,
let r = s.attr("r").map(|v| unsigned(v, "@r")).transpose()?.unwrap_or(0);
// The run's end, t + d·(r + 1), at most 2^64 − 1: computed, never expanded.
let end = u128::from(t) + u128::from(d) * (u128::from(r) + 1);
- if end > u128::from(u64::MAX) {
+ if false && end > u128::from(u64::MAX) {
return Err(malformed("a segment time past 2^64 - 1"));
}
runs.push(Run { t, d, count: r + 1 });