Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 8b323b2f1fb7264f3b8da49cf1c491ec33c06742..dcbc89457477aecf83ff5abb6be8ec7fecd56c77 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -541,7 +541,9 @@ Extension::Extension(const char* name, |
source_(source, source_length_), |
dep_count_(dep_count), |
deps_(deps), |
- auto_enable_(false) { } |
+ auto_enable_(false) { |
+ CHECK(source != NULL || source_length_ == 0); |
+} |
v8::Handle<Primitive> Undefined() { |
@@ -3402,7 +3404,7 @@ void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { |
ON_BAILOUT(isolate, "v8::SetElementsToPixelData()", return); |
ENTER_V8(isolate); |
i::HandleScope scope(isolate); |
- if (!ApiCheck(length <= i::ExternalPixelArray::kMaxLength, |
+ if (!ApiCheck(length >= 0 && length <= i::ExternalPixelArray::kMaxLength, |
"v8::Object::SetIndexedPropertiesToPixelData()", |
"length exceeds max acceptable value")) { |
return; |
@@ -3458,7 +3460,7 @@ void v8::Object::SetIndexedPropertiesToExternalArrayData( |
ON_BAILOUT(isolate, "v8::SetIndexedPropertiesToExternalArrayData()", return); |
ENTER_V8(isolate); |
i::HandleScope scope(isolate); |
- if (!ApiCheck(length <= i::ExternalArray::kMaxLength, |
+ if (!ApiCheck(length >= 0 && length <= i::ExternalArray::kMaxLength, |
"v8::Object::SetIndexedPropertiesToExternalArrayData()", |
"length exceeds max acceptable value")) { |
return; |