Skip to content

Conversation

@GregMcFarland
Copy link

In base64_decode_block(), step_b & step_c have a bug in that they will cause bits of the next byte to be written even though there are no more bytes in the encoded data. This adds an additional check for more encoded data before writing the additional bits to the next byte.

Additional Information:
The encoder encodes data in 3 byte groups into 4 Base64 characters. If the data being encoded is not a multiple of 3 bytes then the encoder will append = characters in the Base64 data. Therefore you may end up with Base64 data that contains one or more trailing = characters.

When decoding the data the = characters are ignored however the bug in the decoder automatically writes any remaining bits in the current step into the next byte position even if the encoded data has no more bits. Which causes bits outside of the actual encoded data to be modified unexpectedly.

In base64_decode_block(), step_b & step_c have a bug in that they will cause bits of the next byte to be written even though there are no more bytes in the encoded data. This adds an additional check for more encoded data before writing the additional bits to the next byte.
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