Skip to content

Commit

Permalink
src: fix crypto.pbkdf2 callback error argument
Browse files Browse the repository at this point in the history
Callbacks should always return `null` instead of `undefined` if no
error occurred.

PR-URL: nodejs#18458
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
BufoViridis authored and BridgeAR committed Feb 6, 2018
1 parent 075eef5 commit 6a29630
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4943,7 +4943,7 @@ void PBKDF2Request::Work(uv_work_t* work_req) {

void PBKDF2Request::After(Local<Value> (*argv)[2]) {
if (success_) {
(*argv)[0] = Undefined(env()->isolate());
(*argv)[0] = Null(env()->isolate());
(*argv)[1] = Buffer::New(env(), key_, keylen_).ToLocalChecked();
key_ = nullptr;
keylen_ = 0;
Expand Down

0 comments on commit 6a29630

Please sign in to comment.