Skip to content

Verify the first byte when decoding Double/Float#57

Open
fumoboy007 wants to merge 1 commit intohirotakan:masterfrom
fumoboy007:robust
Open

Verify the first byte when decoding Double/Float#57
fumoboy007 wants to merge 1 commit intohirotakan:masterfrom
fumoboy007:robust

Conversation

@fumoboy007
Copy link
Copy Markdown

Currently, the decoding code for Double/Float parses the data without first verifying that the data represents a Double/Float. This is unsafe. For example, a value of type UInt64 could be decoded as a Double with the same bit pattern (but not the same semantic value).

Instead, the decoding code should always check the first byte before continuing to parse the data.

Currently, the decoding code for `Double`/`Float` parses the data without first verifying that the data represents a `Double`/`Float`. This is unsafe. For example, a value of type `UInt64` could be decoded as a `Double` with the same bit pattern (but not the same semantic value).

Instead, the decoding code should always check the first byte before continuing to parse the data.
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