Skip to content

Commit

Permalink
src: fix integer overflow in GetNow
Browse files Browse the repository at this point in the history
PR-URL: nodejs#22214
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
apapirovski authored and trivikr committed Aug 12, 2018
1 parent c8aa83c commit 01a160a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ Local<Value> Environment::GetNow() {
CHECK_GE(now, timer_base());
now -= timer_base();
if (now <= 0xffffffff)
return Integer::New(isolate(), static_cast<uint32_t>(now));
return Integer::NewFromUnsigned(isolate(), static_cast<uint32_t>(now));
else
return Number::New(isolate(), static_cast<double>(now));
}
Expand Down

0 comments on commit 01a160a

Please sign in to comment.