Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(680)

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp

Issue 1967453002: Always check that a Name is a String before converting it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
index e9f59b5159d724373191b39504f6a843e4ecd4c0..8896d65fca9acb5f50bc7c979079bae63b68ffba 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
@@ -65,6 +65,8 @@ static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
+ if (!name->IsString())
+ return;
auto nameString = name.As<v8::String>();
TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(nameString);
@@ -82,6 +84,8 @@ static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
+ if (!name->IsString())
+ return;
auto nameString = name.As<v8::String>();
TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder());
V8StringResource<> propertyName(nameString);
@@ -106,6 +110,8 @@ static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
+ if (!name->IsString())
+ return;
TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
v8::String::Utf8Value namedProperty(name);

Powered by Google App Engine
This is Rietveld 408576698