diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-10-31 10:10:07 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 10:10:07 +0530 |
commit | 8bfd134da6d730cc1d182ab430b1713901d7a5b5 (patch) | |
tree | 2db86e3c5036ac73ebd11944744f87233c7260ed /ext/node | |
parent | a8846eb70f96445753fe5f8f56e6155cb2d0fac6 (diff) |
fix: clamp smi in fast calls by default (#26506)
Fixes https://github.com/denoland/deno/issues/26480
Ref
https://github.com/denoland/deno_core/commit/d2945fb65bca56ebfa7bb80556a4c8f4330d2315
Diffstat (limited to 'ext/node')
-rw-r--r-- | ext/node/ops/crypto/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/node/ops/crypto/mod.rs b/ext/node/ops/crypto/mod.rs index 600d31558..0cf34511b 100644 --- a/ext/node/ops/crypto/mod.rs +++ b/ext/node/ops/crypto/mod.rs @@ -519,11 +519,11 @@ pub fn op_node_dh_compute_secret( } #[op2(fast)] -#[smi] +#[number] pub fn op_node_random_int( - #[smi] min: i32, - #[smi] max: i32, -) -> Result<i32, AnyError> { + #[number] min: i64, + #[number] max: i64, +) -> Result<i64, AnyError> { let mut rng = rand::thread_rng(); // Uniform distribution is required to avoid Modulo Bias // https://en.wikipedia.org/wiki/Fisher–Yates_shuffle#Modulo_bias |