Skip to content

wasmtime-cache: Reject overflowing duration values - #14060

Open
racequite wants to merge 1 commit into
bytecodealliance:mainfrom
racequite:fix/cache-duration-overflow
Open

wasmtime-cache: Reject overflowing duration values#14060
racequite wants to merge 1 commit into
bytecodealliance:mainfrom
racequite:fix/cache-duration-overflow

Conversation

@racequite

Copy link
Copy Markdown

The cache configuration duration deserializer uses unchecked multiplication when converting minutes, hours, and days to seconds. Oversized values therefore panic when overflow checks are enabled and wrap otherwise. For example, 307445734561825861m wraps to 44 seconds in a release build and is then accepted by configuration validation.

Use u64::checked_mul for the affected units so overflow is reported through the existing invalid-configuration path. Add regression coverage for the first overflowing minute, hour, and day values.

@racequite
racequite requested a review from a team as a code owner August 1, 2026 17:49
@racequite
racequite requested review from dicej and removed request for a team August 1, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant