@@ -71,7 +71,6 @@ using v8::ObjectTemplate;
7171using v8::Promise;
7272using v8::String;
7373using v8::Symbol;
74- using v8::Uint32;
7574using v8::Undefined;
7675using v8::Value;
7776
@@ -2184,11 +2183,11 @@ static void Chown(const FunctionCallbackInfo<Value>& args) {
21842183 BufferValue path (env->isolate (), args[0 ]);
21852184 CHECK_NOT_NULL (*path);
21862185
2187- CHECK (args[1 ]-> IsUint32 ( ));
2188- const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Uint32 >()->Value ());
2186+ CHECK (IsSafeJsInt ( args[1 ]));
2187+ const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Integer >()->Value ());
21892188
2190- CHECK (args[2 ]-> IsUint32 ( ));
2191- const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Uint32 >()->Value ());
2189+ CHECK (IsSafeJsInt ( args[2 ]));
2190+ const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Integer >()->Value ());
21922191
21932192 FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
21942193 if (req_wrap_async != nullptr ) { // chown(path, uid, gid, req)
@@ -2217,11 +2216,11 @@ static void FChown(const FunctionCallbackInfo<Value>& args) {
22172216 CHECK (args[0 ]->IsInt32 ());
22182217 const int fd = args[0 ].As <Int32>()->Value ();
22192218
2220- CHECK (args[1 ]-> IsUint32 ( ));
2221- const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Uint32 >()->Value ());
2219+ CHECK (IsSafeJsInt ( args[1 ]));
2220+ const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Integer >()->Value ());
22222221
2223- CHECK (args[2 ]-> IsUint32 ( ));
2224- const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Uint32 >()->Value ());
2222+ CHECK (IsSafeJsInt ( args[2 ]));
2223+ const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Integer >()->Value ());
22252224
22262225 FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
22272226 if (req_wrap_async != nullptr ) { // fchown(fd, uid, gid, req)
@@ -2247,11 +2246,11 @@ static void LChown(const FunctionCallbackInfo<Value>& args) {
22472246 BufferValue path (env->isolate (), args[0 ]);
22482247 CHECK_NOT_NULL (*path);
22492248
2250- CHECK (args[1 ]-> IsUint32 ( ));
2251- const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Uint32 >()->Value ());
2249+ CHECK (IsSafeJsInt ( args[1 ]));
2250+ const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Integer >()->Value ());
22522251
2253- CHECK (args[2 ]-> IsUint32 ( ));
2254- const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Uint32 >()->Value ());
2252+ CHECK (IsSafeJsInt ( args[2 ]));
2253+ const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Integer >()->Value ());
22552254
22562255 FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
22572256 if (req_wrap_async != nullptr ) { // lchown(path, uid, gid, req)
0 commit comments