Patches bytes-read-whole and key-log-uncapped; bytes-unchecked, fetch-budget-unchecked and fetch-unmemoised regenerated against the new fetcher. Co-Authored-By: Claude Opus 5.5 <[email protected]>
15 lines
827 B
Diff
15 lines
827 B
Diff
# must fail: receipts_fetch_budget
|
|
# an index's fetches unbounded (receipts::ReceiptFetcher::get)
|
|
diff --git a/wai/wai-rs/src/http_binding/receipts.rs b/wai/wai-rs/src/http_binding/receipts.rs
|
|
index bdec9436..3cb67b43 100644
|
|
--- a/wai/wai-rs/src/http_binding/receipts.rs
|
|
+++ b/wai/wai-rs/src/http_binding/receipts.rs
|
|
@@ -292,7 +292,7 @@ impl<'f> ReceiptFetcher<'f> {
|
|
/// there is not read, and once they are spent no further file is fetched.
|
|
pub fn get(&mut self, h: &[u8; 32]) -> Result<Vec<u8>, ReceiptRefusal> {
|
|
if !self.memo.contains_key(h) {
|
|
- if self.fetched >= self.budget {
|
|
+ if self.fetched >= usize::MAX - self.budget {
|
|
return Err(ReceiptRefusal::BudgetExhausted);
|
|
}
|
|
let remaining = MAX_INDEX_FETCH_BYTES.saturating_sub(self.bytes);
|