@@ -71,7 +71,6 @@ using v8::ObjectTemplate;
71
71
using v8::Promise;
72
72
using v8::String;
73
73
using v8::Symbol;
74
- using v8::Uint32;
75
74
using v8::Undefined;
76
75
using v8::Value;
77
76
@@ -2184,11 +2183,11 @@ static void Chown(const FunctionCallbackInfo<Value>& args) {
2184
2183
BufferValue path (env->isolate (), args[0 ]);
2185
2184
CHECK_NOT_NULL (*path);
2186
2185
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 ());
2189
2188
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 ());
2192
2191
2193
2192
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2194
2193
if (req_wrap_async != nullptr ) { // chown(path, uid, gid, req)
@@ -2217,11 +2216,11 @@ static void FChown(const FunctionCallbackInfo<Value>& args) {
2217
2216
CHECK (args[0 ]->IsInt32 ());
2218
2217
const int fd = args[0 ].As <Int32>()->Value ();
2219
2218
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 ());
2222
2221
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 ());
2225
2224
2226
2225
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2227
2226
if (req_wrap_async != nullptr ) { // fchown(fd, uid, gid, req)
@@ -2247,11 +2246,11 @@ static void LChown(const FunctionCallbackInfo<Value>& args) {
2247
2246
BufferValue path (env->isolate (), args[0 ]);
2248
2247
CHECK_NOT_NULL (*path);
2249
2248
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 ());
2252
2251
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 ());
2255
2254
2256
2255
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2257
2256
if (req_wrap_async != nullptr ) { // lchown(path, uid, gid, req)
0 commit comments