Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't decode ZSTs #454

Merged
merged 3 commits into from
Dec 16, 2023
Merged

fix: don't decode ZSTs #454

merged 3 commits into from
Dec 16, 2023

Conversation

prestwich
Copy link
Member

Motivation

Closes #392

Fix here prevents zero-sized types from adding significant overhead to decoding, this is an alternative to the proposed fix of disabling instantiation of ZSTs. DynSolType has many instantiation vectors, and we may not be able to effectively prevent incorrect use of all of them.

Followup: research whether we can do this effectively

Solution

Add an is_zst check to decoding, which short-circuits decoding of zero-sized values.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@prestwich prestwich added the bug Something isn't working label Dec 15, 2023
@prestwich prestwich self-assigned this Dec 15, 2023
@prestwich prestwich merged commit 5233e0f into main Dec 16, 2023
21 checks passed
@prestwich prestwich deleted the prestwich/dos-prevention branch December 16, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Zero-sized-types cause DoS when parsed
2 participants