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: crypto.randomBytes results in an abort #664

Closed
zyscoder opened this issue Apr 13, 2021 · 0 comments
Closed

Bug: crypto.randomBytes results in an abort #664

zyscoder opened this issue Apr 13, 2021 · 0 comments
Labels

Comments

@zyscoder
Copy link

Bug Report

What steps will reproduce the bug?

Setup a fibjs instance,

» fibjs

and run the following javascript code.

crypto=require('crypto'); crypto.randomBytes(-125)

Then the fibjs instance occurs an abort.

How often does it reproduce? Is there a required condition?

This problem can always be triggered following the steps above.

What is the expected behavior?

If any error occurs, an exception or other similar error-reporting stuff should be thrown. There is no reason to crash the whole fibjs process.

What do you see instead?

» fibjs
Welcome to fibjs 0.33.0-dev.
Type ".help" for more information.
> crypto=require('crypto'); crypto.randomBytes(-125)
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
[1]    37096 abort (core dumped)  /home/zys/Toolchains/fibjs/bin/Linux_amd64_release/fibjs
@xicilion xicilion added the bug label Apr 13, 2021
xicilion added a commit that referenced this issue Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants