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

Bug in Base58 implementation #1223

Closed
shargon opened this issue Nov 11, 2019 · 0 comments · Fixed by #1224
Closed

Bug in Base58 implementation #1223

shargon opened this issue Nov 11, 2019 · 0 comments · Fixed by #1224
Assignees
Labels
Bug Used to tag confirmed bugs

Comments

@shargon
Copy link
Member

shargon commented Nov 11, 2019

Describe the bug
Base58 doesn't work as expected when dealing with empty arrays

To Reproduce
Steps to reproduce the behavior:

  1. Create an empty array var data=new byte[32];
  2. Try to encode and decode it
  3. You won't obtain the same result
var buffer = new byte[32];
var str = Base58.Encode(buffer);
var deco = Base58.Decode(str);
if (!buffer.SequenceEqual(deco)) throw new Exception(); 

Expected behavior
Obtain the same encoded data

Screenshots

It was discovered during the red4sec fuzzing phase

image

@shargon shargon added Bug Used to tag confirmed bugs port-to-2.x labels Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Used to tag confirmed bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant