From 07804c7c9a4c2eb50eb897fa5e41cb8c9e5a1ab5 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 14 Sep 2012 01:59:44 +0200 Subject: fs: don't segfault on deeply recursive stat() Check that the calls to Integer::New() and Date::New() succeed and bail out if they don't. V8 returns an empty handle on stack overflow. Trying to set the empty handle as a property on an object results in a NULL pointer dereference in release builds and an assert in debug builds. Fixes #4015. --- test/fixtures/test-regress-GH-4015.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test/fixtures/test-regress-GH-4015.js (limited to 'test/fixtures/test-regress-GH-4015.js') diff --git a/test/fixtures/test-regress-GH-4015.js b/test/fixtures/test-regress-GH-4015.js new file mode 100644 index 0000000000..0d9c05d6d7 --- /dev/null +++ b/test/fixtures/test-regress-GH-4015.js @@ -0,0 +1,7 @@ +var fs = require('fs'); + +function load() { + fs.statSync('.'); + load(); +} +load(); -- cgit v1.2.1