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

UnkeyedDecodingContainer - corrupted data causes crash #69

Open
skyfoxa opened this issue Oct 11, 2021 · 1 comment
Open

UnkeyedDecodingContainer - corrupted data causes crash #69

skyfoxa opened this issue Oct 11, 2021 · 1 comment

Comments

@skyfoxa
Copy link

skyfoxa commented Oct 11, 2021

Could we add a guard check before we touch data array with start and end indexes? We should throw an error if data doesn't contain requested range. It causes fatal error if data array doesn't contain range.startIndex..<(range.endIndex)

let container = _CBORDecoder.SingleValueContainer(data: self.data[range.startIndex..<(range.endIndex)], codingPath: self.codingPath, userInfo: self.userInfo)
@skyfoxa skyfoxa changed the title UnkeyedDecodingContainer - corrupted data causes crashe UnkeyedDecodingContainer - corrupted data causes crash Oct 11, 2021
@hamchapman
Copy link
Collaborator

A PR for this would be great - are you able to give it a go? Then I can review and we can get something merged

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

No branches or pull requests

2 participants