Skip to content

Commit

Permalink
fs: fix stat dev unsigned cast overflow
Browse files Browse the repository at this point in the history
The `dev_t` is unsigned on Linux, use Integer::NewFromUnsigned to fix cast overflow

PR-URL: #16705
Fixes: #16496
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
JLHwung authored and MylesBorins committed Nov 28, 2017
1 parent f0eeddb commit 925e58f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,6 @@ Local<Value> BuildStatsObject(Environment* env, const uv_stat_t* s) {
# else
Local<Value> blksize = Undefined(env->isolate());
# endif
#undef X

// Integers.
#define X(name) \
Local<Value> name = Integer::New(env->isolate(), s->st_##name); \
if (name.IsEmpty()) \
return Local<Object>(); \

X(dev)
X(mode)
X(nlink)
Expand Down

0 comments on commit 925e58f

Please sign in to comment.