summaryrefslogtreecommitdiff
path: root/src/stream_base-inl.h
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2015-03-23 00:26:59 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2015-03-23 10:40:12 +0100
commit7e88a9322c8f1b5393723d6f99590d750b097569 (patch)
treeef3f4d358d11d2db3b8c4a0ca75ad27e97e61ebe /src/stream_base-inl.h
parent20c4498e76af9bd639a752aae3e36571251c3c2d (diff)
downloadandroid-node-v8-7e88a9322c8f1b5393723d6f99590d750b097569.tar.gz
android-node-v8-7e88a9322c8f1b5393723d6f99590d750b097569.tar.bz2
android-node-v8-7e88a9322c8f1b5393723d6f99590d750b097569.zip
src: make accessors immune to context confusion
It's possible for an accessor or named interceptor to get called with a different execution context than the one it lives in, see the test case for an example using the debug API. This commit fortifies against that by passing the environment as a data property instead of looking it up through the current context. Fixes: https://github.com/iojs/io.js/issues/1190 (again) PR-URL: https://github.com/iojs/io.js/pull/1238 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'src/stream_base-inl.h')
-rw-r--r--src/stream_base-inl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h
index 8f7f5fea41..26ba54b376 100644
--- a/src/stream_base-inl.h
+++ b/src/stream_base-inl.h
@@ -32,7 +32,7 @@ void StreamBase::AddMethods(Environment* env,
t->InstanceTemplate()->SetAccessor(env->fd_string(),
GetFD<Base>,
nullptr,
- Handle<Value>(),
+ env->as_external(),
v8::DEFAULT,
attributes);