Skip to content

Conversation

palto42
Copy link

@palto42 palto42 commented May 6, 2018

The encode and decode length must not include the terminating \0 of the string and the length of the output char array must be 1 larger for the \0 added at the end.
The first point caused incorrect encoding and the second caused an overwrite of the first char of the input string.
I validated the encoding of "Hello world" on Ubuntu CLI using echo -n 'Hello world' | base64

@sebastienvermeille
Copy link

sebastienvermeille commented May 9, 2024

I had the same issue with a special char appended when I decoded message encoded with this library.

Using the changes of this PR it works like a charm thank you @palto42

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.

2 participants