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

Unified Diff: chrome/renderer/resources/json_schema.js

Issue 5018002: Fixes a crash when entering a negative index with chrome.tabs.move .... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 years, 1 month 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: chrome/renderer/resources/json_schema.js
===================================================================
--- chrome/renderer/resources/json_schema.js (revision 65777)
+++ chrome/renderer/resources/json_schema.js (working copy)
@@ -380,10 +380,10 @@
*/
chromeHidden.JSONSchemaValidator.prototype.validateString = function(
instance, schema, path) {
- if (schema.minLength && instance.length < schema.minLength)
+ if ('minLength' in schema && instance.length < schema.minLength)
this.addError(path, "stringMinLength", [schema.minLength]);
- if (schema.maxLength && instance.length > schema.maxLength)
+ if ('maxLength' in schema && instance.length > schema.maxLength)
this.addError(path, "stringMaxLength", [schema.maxLength]);
if (schema.pattern && !schema.pattern.test(instance))
@@ -405,10 +405,10 @@
instance == Number.NEGATIVE_INFINITY )
this.addError(path, "numberFiniteNotNan", [instance]);
- if (schema.minimum && instance < schema.minimum)
+ if ('minimum' in schema && instance < schema.minimum)
this.addError(path, "numberMinValue", [schema.minimum]);
- if (schema.maximum && instance > schema.maximum)
+ if ('maximum' in schema && instance > schema.maximum)
this.addError(path, "numberMaxValue", [schema.maximum]);
if (schema.maxDecimal && instance * Math.pow(10, schema.maxDecimal) % 1)

Powered by Google App Engine
This is Rietveld 408576698