@@ -1140,6 +1140,7 @@ static void LStat(const FunctionCallbackInfo<Value>& args) {
1140
1140
bool use_bigint = args[1 ]->IsTrue ();
1141
1141
if (!args[2 ]->IsUndefined ()) { // lstat(path, use_bigint, req)
1142
1142
FSReqBase* req_wrap_async = GetReqWrap (args, 2 , use_bigint);
1143
+ CHECK_NOT_NULL (req_wrap_async);
1143
1144
FS_ASYNC_TRACE_BEGIN1 (
1144
1145
UV_FS_LSTAT, req_wrap_async, " path" , TRACE_STR_COPY (*path))
1145
1146
AsyncCall (env, req_wrap_async, args, " lstat" , UTF8, AfterStat,
@@ -1182,6 +1183,7 @@ static void FStat(const FunctionCallbackInfo<Value>& args) {
1182
1183
bool use_bigint = args[1 ]->IsTrue ();
1183
1184
if (!args[2 ]->IsUndefined ()) { // fstat(fd, use_bigint, req)
1184
1185
FSReqBase* req_wrap_async = GetReqWrap (args, 2 , use_bigint);
1186
+ CHECK_NOT_NULL (req_wrap_async);
1185
1187
FS_ASYNC_TRACE_BEGIN0 (UV_FS_FSTAT, req_wrap_async)
1186
1188
AsyncCall (env, req_wrap_async, args, " fstat" , UTF8, AfterStat,
1187
1189
uv_fs_fstat, fd);
@@ -1283,6 +1285,7 @@ static void Symlink(const FunctionCallbackInfo<Value>& args) {
1283
1285
1284
1286
if (argc > 3 ) { // symlink(target, path, flags, req)
1285
1287
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
1288
+ CHECK_NOT_NULL (req_wrap_async);
1286
1289
FS_ASYNC_TRACE_BEGIN2 (UV_FS_SYMLINK,
1287
1290
req_wrap_async,
1288
1291
" target" ,
@@ -1321,6 +1324,7 @@ static void Link(const FunctionCallbackInfo<Value>& args) {
1321
1324
1322
1325
if (argc > 2 ) { // link(src, dest, req)
1323
1326
FSReqBase* req_wrap_async = GetReqWrap (args, 2 );
1327
+ CHECK_NOT_NULL (req_wrap_async);
1324
1328
// To avoid bypass the link target should be allowed to read and write
1325
1329
ASYNC_THROW_IF_INSUFFICIENT_PERMISSIONS (
1326
1330
env,
@@ -1379,6 +1383,7 @@ static void ReadLink(const FunctionCallbackInfo<Value>& args) {
1379
1383
1380
1384
if (argc > 2 ) { // readlink(path, encoding, req)
1381
1385
FSReqBase* req_wrap_async = GetReqWrap (args, 2 );
1386
+ CHECK_NOT_NULL (req_wrap_async);
1382
1387
FS_ASYNC_TRACE_BEGIN1 (
1383
1388
UV_FS_READLINK, req_wrap_async, " path" , TRACE_STR_COPY (*path))
1384
1389
AsyncCall (env, req_wrap_async, args, " readlink" , encoding, AfterStringPtr,
@@ -1425,6 +1430,7 @@ static void Rename(const FunctionCallbackInfo<Value>& args) {
1425
1430
1426
1431
if (argc > 2 ) { // rename(old_path, new_path, req)
1427
1432
FSReqBase* req_wrap_async = GetReqWrap (args, 2 );
1433
+ CHECK_NOT_NULL (req_wrap_async);
1428
1434
ASYNC_THROW_IF_INSUFFICIENT_PERMISSIONS (
1429
1435
env,
1430
1436
req_wrap_async,
@@ -1482,6 +1488,7 @@ static void FTruncate(const FunctionCallbackInfo<Value>& args) {
1482
1488
1483
1489
if (argc > 2 ) { // ftruncate(fd, len, req)
1484
1490
FSReqBase* req_wrap_async = GetReqWrap (args, 2 );
1491
+ CHECK_NOT_NULL (req_wrap_async);
1485
1492
FS_ASYNC_TRACE_BEGIN0 (UV_FS_FTRUNCATE, req_wrap_async)
1486
1493
AsyncCall (env, req_wrap_async, args, " ftruncate" , UTF8, AfterNoArgs,
1487
1494
uv_fs_ftruncate, fd, len);
@@ -1591,6 +1598,7 @@ static void RMDir(const FunctionCallbackInfo<Value>& args) {
1591
1598
1592
1599
if (argc > 1 ) {
1593
1600
FSReqBase* req_wrap_async = GetReqWrap (args, 1 ); // rmdir(path, req)
1601
+ CHECK_NOT_NULL (req_wrap_async);
1594
1602
FS_ASYNC_TRACE_BEGIN1 (
1595
1603
UV_FS_RMDIR, req_wrap_async, " path" , TRACE_STR_COPY (*path))
1596
1604
AsyncCall (env, req_wrap_async, args, " rmdir" , UTF8, AfterNoArgs,
@@ -1788,6 +1796,7 @@ static void MKDir(const FunctionCallbackInfo<Value>& args) {
1788
1796
1789
1797
if (argc > 3 ) { // mkdir(path, mode, recursive, req)
1790
1798
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
1799
+ CHECK_NOT_NULL (req_wrap_async);
1791
1800
FS_ASYNC_TRACE_BEGIN1 (
1792
1801
UV_FS_UNLINK, req_wrap_async, " path" , TRACE_STR_COPY (*path))
1793
1802
AsyncCall (env, req_wrap_async, args, " mkdir" , UTF8,
@@ -1839,6 +1848,7 @@ static void RealPath(const FunctionCallbackInfo<Value>& args) {
1839
1848
1840
1849
if (argc > 2 ) { // realpath(path, encoding, req)
1841
1850
FSReqBase* req_wrap_async = GetReqWrap (args, 2 );
1851
+ CHECK_NOT_NULL (req_wrap_async);
1842
1852
FS_ASYNC_TRACE_BEGIN1 (
1843
1853
UV_FS_REALPATH, req_wrap_async, " path" , TRACE_STR_COPY (*path))
1844
1854
AsyncCall (env, req_wrap_async, args, " realpath" , encoding, AfterStringPtr,
@@ -1906,6 +1916,7 @@ static void ReadDir(const FunctionCallbackInfo<Value>& args) {
1906
1916
1907
1917
if (argc > 3 ) { // readdir(path, encoding, withTypes, req)
1908
1918
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
1919
+ CHECK_NOT_NULL (req_wrap_async);
1909
1920
ASYNC_THROW_IF_INSUFFICIENT_PERMISSIONS (
1910
1921
env,
1911
1922
req_wrap_async,
@@ -2146,6 +2157,7 @@ static void CopyFile(const FunctionCallbackInfo<Value>& args) {
2146
2157
2147
2158
if (argc > 3 ) { // copyFile(src, dest, flags, req)
2148
2159
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2160
+ CHECK_NOT_NULL (req_wrap_async);
2149
2161
ASYNC_THROW_IF_INSUFFICIENT_PERMISSIONS (
2150
2162
env,
2151
2163
req_wrap_async,
@@ -2269,6 +2281,7 @@ static void WriteBuffers(const FunctionCallbackInfo<Value>& args) {
2269
2281
2270
2282
if (argc > 3 ) { // writeBuffers(fd, chunks, pos, req)
2271
2283
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2284
+ CHECK_NOT_NULL (req_wrap_async);
2272
2285
FS_ASYNC_TRACE_BEGIN0 (UV_FS_WRITE, req_wrap_async)
2273
2286
AsyncCall (env,
2274
2287
req_wrap_async,
@@ -2643,6 +2656,7 @@ static void ReadBuffers(const FunctionCallbackInfo<Value>& args) {
2643
2656
2644
2657
if (argc > 3 ) { // readBuffers(fd, buffers, pos, req)
2645
2658
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2659
+ CHECK_NOT_NULL (req_wrap_async);
2646
2660
FS_ASYNC_TRACE_BEGIN0 (UV_FS_READ, req_wrap_async)
2647
2661
AsyncCall (env, req_wrap_async, args, " read" , UTF8, AfterInteger,
2648
2662
uv_fs_read, fd, *iovs, iovs.length (), pos);
@@ -2680,6 +2694,7 @@ static void Chmod(const FunctionCallbackInfo<Value>& args) {
2680
2694
2681
2695
if (argc > 2 ) { // chmod(path, mode, req)
2682
2696
FSReqBase* req_wrap_async = GetReqWrap (args, 2 );
2697
+ CHECK_NOT_NULL (req_wrap_async);
2683
2698
FS_ASYNC_TRACE_BEGIN1 (
2684
2699
UV_FS_CHMOD, req_wrap_async, " path" , TRACE_STR_COPY (*path))
2685
2700
AsyncCall (env, req_wrap_async, args, " chmod" , UTF8, AfterNoArgs,
@@ -2712,6 +2727,7 @@ static void FChmod(const FunctionCallbackInfo<Value>& args) {
2712
2727
2713
2728
if (argc > 2 ) { // fchmod(fd, mode, req)
2714
2729
FSReqBase* req_wrap_async = GetReqWrap (args, 2 );
2730
+ CHECK_NOT_NULL (req_wrap_async);
2715
2731
FS_ASYNC_TRACE_BEGIN0 (UV_FS_FCHMOD, req_wrap_async)
2716
2732
AsyncCall (env, req_wrap_async, args, " fchmod" , UTF8, AfterNoArgs,
2717
2733
uv_fs_fchmod, fd, mode);
@@ -2789,6 +2805,7 @@ static void FChown(const FunctionCallbackInfo<Value>& args) {
2789
2805
2790
2806
if (argc > 3 ) { // fchown(fd, uid, gid, req)
2791
2807
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2808
+ CHECK_NOT_NULL (req_wrap_async);
2792
2809
FS_ASYNC_TRACE_BEGIN0 (UV_FS_FCHOWN, req_wrap_async)
2793
2810
AsyncCall (env, req_wrap_async, args, " fchown" , UTF8, AfterNoArgs,
2794
2811
uv_fs_fchown, fd, uid, gid);
@@ -2819,6 +2836,7 @@ static void LChown(const FunctionCallbackInfo<Value>& args) {
2819
2836
2820
2837
if (argc > 3 ) { // lchown(path, uid, gid, req)
2821
2838
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2839
+ CHECK_NOT_NULL (req_wrap_async);
2822
2840
ASYNC_THROW_IF_INSUFFICIENT_PERMISSIONS (
2823
2841
env,
2824
2842
req_wrap_async,
@@ -2861,6 +2879,7 @@ static void UTimes(const FunctionCallbackInfo<Value>& args) {
2861
2879
2862
2880
if (argc > 3 ) { // utimes(path, atime, mtime, req)
2863
2881
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2882
+ CHECK_NOT_NULL (req_wrap_async);
2864
2883
FS_ASYNC_TRACE_BEGIN1 (
2865
2884
UV_FS_UTIME, req_wrap_async, " path" , TRACE_STR_COPY (*path))
2866
2885
AsyncCall (env, req_wrap_async, args, " utime" , UTF8, AfterNoArgs,
@@ -2893,6 +2912,7 @@ static void FUTimes(const FunctionCallbackInfo<Value>& args) {
2893
2912
2894
2913
if (argc > 3 ) { // futimes(fd, atime, mtime, req)
2895
2914
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2915
+ CHECK_NOT_NULL (req_wrap_async);
2896
2916
FS_ASYNC_TRACE_BEGIN0 (UV_FS_FUTIME, req_wrap_async)
2897
2917
AsyncCall (env, req_wrap_async, args, " futime" , UTF8, AfterNoArgs,
2898
2918
uv_fs_futime, fd, atime, mtime);
@@ -2925,6 +2945,7 @@ static void LUTimes(const FunctionCallbackInfo<Value>& args) {
2925
2945
2926
2946
if (argc > 3 ) { // lutimes(path, atime, mtime, req)
2927
2947
FSReqBase* req_wrap_async = GetReqWrap (args, 3 );
2948
+ CHECK_NOT_NULL (req_wrap_async);
2928
2949
FS_ASYNC_TRACE_BEGIN1 (
2929
2950
UV_FS_LUTIME, req_wrap_async, " path" , TRACE_STR_COPY (*path))
2930
2951
AsyncCall (env, req_wrap_async, args, " lutime" , UTF8, AfterNoArgs,
@@ -2957,6 +2978,7 @@ static void Mkdtemp(const FunctionCallbackInfo<Value>& args) {
2957
2978
2958
2979
if (argc > 2 ) { // mkdtemp(tmpl, encoding, req)
2959
2980
FSReqBase* req_wrap_async = GetReqWrap (args, 2 );
2981
+ CHECK_NOT_NULL (req_wrap_async);
2960
2982
ASYNC_THROW_IF_INSUFFICIENT_PERMISSIONS (
2961
2983
env,
2962
2984
req_wrap_async,
0 commit comments