Skip to content

Commit

Permalink
src: fix dead code in RandomPrimeTraits
Browse files Browse the repository at this point in the history
PR-URL: nodejs#37083
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
tniessen committed Jan 29, 2021
1 parent 17467d1 commit 0a993e1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/crypto/crypto_random.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ Maybe<bool> RandomPrimeTraits::AdditionalConfig(
return Nothing<bool>();
}
ArrayBufferOrViewContents<unsigned char> add(args[offset + 2]);
BN_bin2bn(add.data(), add.size(), params->add.get());
if (!params->add) {
if (BN_bin2bn(add.data(), add.size(), params->add.get()) == nullptr) {
THROW_ERR_INVALID_ARG_VALUE(env, "invalid options.add");
return Nothing<bool>();
}
Expand All @@ -124,8 +123,7 @@ Maybe<bool> RandomPrimeTraits::AdditionalConfig(
return Nothing<bool>();
}
ArrayBufferOrViewContents<unsigned char> rem(args[offset + 3]);
BN_bin2bn(rem.data(), rem.size(), params->rem.get());
if (!params->rem) {
if (BN_bin2bn(rem.data(), rem.size(), params->rem.get()) == nullptr) {
THROW_ERR_INVALID_ARG_VALUE(env, "invalid options.rem");
return Nothing<bool>();
}
Expand Down

0 comments on commit 0a993e1

Please sign in to comment.