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

jsthemis: Add missing returns after errors #999

Merged
merged 2 commits into from
May 25, 2023

Conversation

G1gg1L3s
Copy link
Collaborator

@G1gg1L3s G1gg1L3s commented May 22, 2023

There were two places in the code with missing return statements after errors. As a result, if something in key generation goes wrong, the wrapper will segfault while trying to allocate huge vectors for the keys.

It's interesting how these bugs remained unnoticed for such a long time (~4 years). This is because it's hard to make key pair generation fail and it works surprisingly well most of the time :)

This change will prevent some of the segfaults in the #996, but will not resolve the issue.

Checklist

  • Change is covered by automated tests
  • Benchmark results are attached (if applicable)
  • The coding guidelines are followed
  • Public API has proper documentation
  • Example projects and code samples are up-to-date (in case of API changes)
  • Changelog is updated (in case of notable or breaking changes)

There were two places in the code with missing return statements
after errors. As a result, if something in key generation goes
wrong, the wrapper will segfault while trying to allocate huge
vectors for the keys.

It's interesting how these bugs remained unnoticed for such a
long time (~4 years). This is because it's hard to make key pair
generation fail. It works surprisingly well most of the time :)
@G1gg1L3s G1gg1L3s merged commit be54e99 into cossacklabs:master May 25, 2023
@G1gg1L3s G1gg1L3s deleted the jsthemis-add-return-after-error branch May 25, 2023 11:33
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