Skip to content

Commit

Permalink
Bad array index in AfterStat()
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jun 29, 2009
1 parent e763efd commit c2bdc01
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,7 @@ AfterStat (eio_req *req)

HandleScope scope;

Local<Value> argv[1];
Local<Object> stats = Object::New();
argv[1] = stats;

struct stat *s = reinterpret_cast<struct stat*>(req->ptr2);

Expand Down Expand Up @@ -375,6 +373,7 @@ AfterStat (eio_req *req)
/* time of last status change */
stats->Set(CTIME_SYMBOL, Date::New(1000*static_cast<double>(s->st_ctime)));

Local<Value> argv[1] = { stats };
promise->EmitSuccess(1, argv);

return 0;
Expand Down

0 comments on commit c2bdc01

Please sign in to comment.