Patches (falsify/run.sh), each failing the corpus cases it names: bytes-unchecked, decision-unchecked, recovery-record-unchecked, operating-point-unchecked, session-accepted, declaration-unnamed, first-publisher, matchers-need-object and set-sha-faults; claim-through-any-receipt, fetch-unmemoised, fetch-budget-unchecked and file-cap-unchecked regenerated against the new receipts.rs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
15 lines
842 B
Diff
15 lines
842 B
Diff
# must fail: receipts_file_too_large receipts_parent_too_large
|
|
# a receipt file over 1 MiB read (receipts::ReceiptFetcher::get)
|
|
diff --git a/wai/wai-rs/src/http_binding/receipts.rs b/wai/wai-rs/src/http_binding/receipts.rs
|
|
index 83cd7ccb..822b9975 100644
|
|
--- a/wai/wai-rs/src/http_binding/receipts.rs
|
|
+++ b/wai/wai-rs/src/http_binding/receipts.rs
|
|
@@ -307,7 +307,7 @@ impl<'f> ReceiptFetcher<'f> {
|
|
match &self.memo[h] {
|
|
Served::Nothing => Err(ReceiptRefusal::NotServed),
|
|
Served::PastBytes => Err(ReceiptRefusal::BytesExhausted),
|
|
- Served::Bytes(b) if b.len() > MAX_RECEIPT_FILE_BYTES => Err(ReceiptRefusal::TooLarge),
|
|
+ Served::Bytes(b) if b.len() > usize::MAX - MAX_RECEIPT_FILE_BYTES => Err(ReceiptRefusal::TooLarge),
|
|
Served::Bytes(b) => Ok(b.clone()),
|
|
}
|
|
}
|