mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
fs: use IsSafeJsInt instead of IsNumber for ftruncate
PR-URL: https://github.com/nodejs/node/pull/26572 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
0bbda5e5ae
commit
a3c0014e73
@ -1130,7 +1130,7 @@ static void FTruncate(const FunctionCallbackInfo<Value>& args) {
|
||||
CHECK(args[0]->IsInt32());
|
||||
const int fd = args[0].As<Int32>()->Value();
|
||||
|
||||
CHECK(args[1]->IsNumber());
|
||||
CHECK(IsSafeJsInt(args[1]));
|
||||
const int64_t len = args[1].As<Integer>()->Value();
|
||||
|
||||
FSReqBase* req_wrap_async = GetReqWrap(env, args[2]);
|
||||
|
Loading…
Reference in New Issue
Block a user