0
0
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:
Zach Bjornson 2019-03-27 13:34:02 -07:00 committed by Rich Trott
parent 0bbda5e5ae
commit a3c0014e73

View File

@ -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]);