Description: Fix for CVE-2014-5256 Bug-Node: https://github.com/joyent/node/commit/530af9cb8e700e7596b3ec812bad123c9fa06356 Author: Fedor Indutny Acked-by: Jean Baptiste Favre Last-Update: 2014-11-15 Applied-Upstream: https://github.com/joyent/node/commit/530af9cb8e700e7596b3ec812bad123c9fa06356 --- a/src/isolate.h +++ b/src/isolate.h @@ -1405,14 +1405,9 @@ public: explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { } - bool HasOverflowed() const { + inline bool HasOverflowed() const { StackGuard* stack_guard = isolate_->stack_guard(); - // Stack has overflowed in C++ code only if stack pointer exceeds the C++ - // stack guard and the limits are not set to interrupt values. - // TODO(214): Stack overflows are ignored if a interrupt is pending. This - // code should probably always use the initial C++ limit. - return (reinterpret_cast(this) < stack_guard->climit()) && - stack_guard->IsStackOverflow(); + return reinterpret_cast(this) < stack_guard->real_climit(); } private: Isolate* isolate_;