From a3c8ebd709784114d63a1bd79eabb9135d20a639 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 4 Jul 2021 01:07:40 +0100 Subject: LibJS: VERIFY() that property name is valid in Value::get{,_method}() --- Userland/Libraries/LibJS/Runtime/Value.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Userland') diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 4c8f97a5bb..a622beb72c 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -799,6 +799,7 @@ Value Value::get(GlobalObject& global_object, PropertyName const& property_name) auto& vm = global_object.vm(); // 1. Assert: IsPropertyKey(P) is true. + VERIFY(property_name.is_valid()); // 2. Let O be ? ToObject(V). auto* object = to_object(global_object); @@ -815,6 +816,7 @@ FunctionObject* Value::get_method(GlobalObject& global_object, PropertyName cons auto& vm = global_object.vm(); // 1. Assert: IsPropertyKey(P) is true. + VERIFY(property_name.is_valid()); // 2. Let func be ? GetV(V, P). auto function = get(global_object, property_name).value_or(js_undefined()); -- cgit v1.2.3