Bug 839435 - [Packaged apps] Only allow numbers in the 'size' manifest field; r=fabrice

This commit is contained in:
Fernando Jiménez 2013-02-15 19:13:02 +01:00
parent 7d48e0b06e
commit 451869247e

View File

@ -177,8 +177,8 @@ this.AppsUtils = {
},
/**
* from https://developer.mozilla.org/en/OpenWebApps/The_Manifest
* only the name property is mandatory
* From https://developer.mozilla.org/en/OpenWebApps/The_Manifest
* Only the name property is mandatory.
*/
checkManifest: function(aManifest, app) {
if (aManifest.name == undefined)
@ -235,6 +235,14 @@ this.AppsUtils = {
}
}
// The 'size' field must be a positive integer.
if (aManifest.size) {
aManifest.size = parseInt(aManifest.size);
if (Number.isNaN(aManifest.size) || aManifest.size < 0) {
return false;
}
}
return true;
},