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: #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 MylesBorins committed Feb 21, 2018
1 parent e8a75ee commit 3ec3c32
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 @@ -5599,7 +5599,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 3ec3c32

Please sign in to comment.