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 <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
BufoViridis authored and MylesBorins committed Apr 13, 2018
1 parent 16f9631 commit b48ca0a
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 @@ -5421,7 +5421,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 b48ca0a

Please sign in to comment.