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

Infinite recursion in mnemonic_to_entropy_seed function in mnemonics.c #29

Open
quapka opened this issue Dec 9, 2019 · 6 comments
Open
Assignees
Labels
Bug Something isn't working

Comments

@quapka
Copy link

quapka commented Dec 9, 2019

[PA193 Aller team here]

The function mnemonic_to_entropy_seed can be invoked in such a way, that it produces an infinite recursion.

While we've investigated the function further it seems, that the function mnemonic_to_seed should have probably be used instead of the recursive call to back to mnemonic_to_entropy_seed at this line.

The function mnemonic_to_entropy_seed is not mentioned in the README.md, however, it is exportable and documented in mnemonics.h, therefore anyone can get the feeling it can be used.

I'll add a new branch (in my fork) with a new test case, showing the bug (understandably, it leads to segmentation fault).

I'm not proposing any specific fix at the moment, because it can either be fixed or the function mnemonic_to_entropy_seed might get removed altogether (it does not add any functionality it just adds a bug now).

This issue is severe in the sense, that it can crash the whole application, that will call the function in question. The call to the function (as you can see in the branch, that will be linked soon) is not even improper one, it is called with valid arguments.

@quapka
Copy link
Author

quapka commented Dec 9, 2019

The branch fix-issue-29 contains the following commit, that triggers the infinite recursion.

@NimRo97
Copy link
Collaborator

NimRo97 commented Dec 9, 2019 via email

@quapka quapka mentioned this issue Dec 9, 2019
@quapka
Copy link
Author

quapka commented Dec 9, 2019

I've created a pull request to merge the fix into dev branch as them seems to be the way you work :)

@NimRo97
Copy link
Collaborator

NimRo97 commented Dec 9, 2019 via email

@quapka
Copy link
Author

quapka commented Dec 9, 2019

Cool, thanks. Same to you guys!

@AlexInsa
Copy link

Thank you very much, and good luck for you and your team on monday too :)

@NimRo97 NimRo97 self-assigned this Dec 10, 2019
@NimRo97 NimRo97 added the Bug Something isn't working label Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants