SwiftCBOR
SwiftCBOR copied to clipboard
UnkeyedDecodingContainer - corrupted data causes crash
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)
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