@@ -69,7 +69,6 @@ using v8::ObjectTemplate;
69
69
using v8::Promise;
70
70
using v8::String;
71
71
using v8::Symbol;
72
- using v8::Uint32;
73
72
using v8::Undefined;
74
73
using v8::Value;
75
74
@@ -2178,11 +2177,11 @@ static void Chown(const FunctionCallbackInfo<Value>& args) {
2178
2177
BufferValue path (env->isolate (), args[0 ]);
2179
2178
CHECK_NOT_NULL (*path);
2180
2179
2181
- CHECK (args[1 ]-> IsUint32 ( ));
2182
- const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Uint32 >()->Value ());
2180
+ CHECK (IsSafeJsInt ( args[1 ]));
2181
+ const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Integer >()->Value ());
2183
2182
2184
- CHECK (args[2 ]-> IsUint32 ( ));
2185
- const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Uint32 >()->Value ());
2183
+ CHECK (IsSafeJsInt ( args[2 ]));
2184
+ const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Integer >()->Value ());
2186
2185
2187
2186
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2188
2187
if (req_wrap_async != nullptr ) { // chown(path, uid, gid, req)
@@ -2211,11 +2210,11 @@ static void FChown(const FunctionCallbackInfo<Value>& args) {
2211
2210
CHECK (args[0 ]->IsInt32 ());
2212
2211
const int fd = args[0 ].As <Int32>()->Value ();
2213
2212
2214
- CHECK (args[1 ]-> IsUint32 ( ));
2215
- const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Uint32 >()->Value ());
2213
+ CHECK (IsSafeJsInt ( args[1 ]));
2214
+ const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Integer >()->Value ());
2216
2215
2217
- CHECK (args[2 ]-> IsUint32 ( ));
2218
- const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Uint32 >()->Value ());
2216
+ CHECK (IsSafeJsInt ( args[2 ]));
2217
+ const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Integer >()->Value ());
2219
2218
2220
2219
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2221
2220
if (req_wrap_async != nullptr ) { // fchown(fd, uid, gid, req)
@@ -2241,11 +2240,11 @@ static void LChown(const FunctionCallbackInfo<Value>& args) {
2241
2240
BufferValue path (env->isolate (), args[0 ]);
2242
2241
CHECK_NOT_NULL (*path);
2243
2242
2244
- CHECK (args[1 ]-> IsUint32 ( ));
2245
- const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Uint32 >()->Value ());
2243
+ CHECK (IsSafeJsInt ( args[1 ]));
2244
+ const uv_uid_t uid = static_cast <uv_uid_t >(args[1 ].As <Integer >()->Value ());
2246
2245
2247
- CHECK (args[2 ]-> IsUint32 ( ));
2248
- const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Uint32 >()->Value ());
2246
+ CHECK (IsSafeJsInt ( args[2 ]));
2247
+ const uv_gid_t gid = static_cast <uv_gid_t >(args[2 ].As <Integer >()->Value ());
2249
2248
2250
2249
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2251
2250
if (req_wrap_async != nullptr ) { // lchown(path, uid, gid, req)
0 commit comments