Skip to content

Commit

Permalink
fs: use IsSafeJsInt instead of IsNumber for ftruncate
Browse files Browse the repository at this point in the history
PR-URL: #26572
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
zbjornson authored and Trott committed Aug 17, 2019
1 parent 0bbda5e commit a3c0014
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit a3c0014

Please sign in to comment.