diff options
Diffstat (limited to 'lib/crypto')
-rw-r--r-- | lib/crypto/c_src/rand.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/crypto/c_src/rand.c b/lib/crypto/c_src/rand.c index dd1a7a1600..12e0a53493 100644 --- a/lib/crypto/c_src/rand.c +++ b/lib/crypto/c_src/rand.c @@ -64,7 +64,8 @@ ERL_NIF_TERM strong_rand_range_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM if (!BN_rand_range(bn_rand, bn_range)) goto err; - ret = bin_from_bn(env, bn_rand); + if ((ret = bin_from_bn(env, bn_rand)) == atom_error) + goto err; goto done; bad_arg: |