summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFeng Yu <F3n67u@outlook.com>2023-05-15 02:24:15 -0700
committerGitHub <noreply@github.com>2023-05-15 09:24:15 +0000
commit6bbf2a57fcf33266c5859497f8cc32e1389a358a (patch)
treee8c8f2e6dc32f3fa1236441c1d220fc03fb45374 /src
parent8b3777d0c82c01229e724d84586fdc472fd4deda (diff)
downloadnode-new-6bbf2a57fcf33266c5859497f8cc32e1389a358a.tar.gz
vm: fix crash when setting __proto__ on context's globalThis
PR-URL: https://github.com/nodejs/node/pull/47939 Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src')
-rw-r--r--src/node_contextify.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index 7f9f71ba74..eb84d35985 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -530,7 +530,8 @@ void ContextifyContext::PropertySetterCallback(
if (is_declared_on_sandbox &&
ctx->sandbox()
->GetOwnPropertyDescriptor(context, property)
- .ToLocal(&desc)) {
+ .ToLocal(&desc) &&
+ !desc->IsUndefined()) {
Environment* env = Environment::GetCurrent(context);
Local<Object> desc_obj = desc.As<Object>();