From a3c0014e73dcc04718e0d3baf07dd6c453ec6db0 Mon Sep 17 00:00:00 2001 From: Zach Bjornson Date: Wed, 27 Mar 2019 13:34:02 -0700 Subject: [PATCH] fs: use IsSafeJsInt instead of IsNumber for ftruncate PR-URL: https://github.com/nodejs/node/pull/26572 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: Ujjwal Sharma Reviewed-By: James M Snell Reviewed-By: Rich Trott --- src/node_file.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_file.cc b/src/node_file.cc index 5bd0237e7b0556..4301cdc7b4e410 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1130,7 +1130,7 @@ static void FTruncate(const FunctionCallbackInfo& args) { CHECK(args[0]->IsInt32()); const int fd = args[0].As()->Value(); - CHECK(args[1]->IsNumber()); + CHECK(IsSafeJsInt(args[1])); const int64_t len = args[1].As()->Value(); FSReqBase* req_wrap_async = GetReqWrap(env, args[2]);