Bug 775327 - App ID generation and storage is unsafe [r=sicking]

This commit is contained in:
Fabrice Desré 2012-09-05 18:07:21 -07:00
parent c03a995def
commit f076c96d44
2 changed files with 6 additions and 10 deletions

View File

@ -400,16 +400,9 @@ let DOMApplicationRegistry = {
},
_nextLocalId: function() {
// All installed apps have a localId > 1000.
let maxLocalId = 1000;
for (let id in this.webapps) {
if (this.webapps[id].localId > maxLocalId) {
maxLocalId = this.webapps[id].localId;
}
}
return maxLocalId + 1;
let id = Services.prefs.getIntPref("dom.mozApps.maxLocalId") + 1;
Services.prefs.setIntPref("dom.mozApps.maxLocalId", id);
return id;
},
_appId: function(aURI) {

View File

@ -3722,3 +3722,6 @@ pref("toolkit.identity.debug", false);
// Setting that to true grant elevated privileges to apps that ask
// for them in their manifest.
pref("dom.mozApps.dev_mode", false);
// Lowest localId for installed apps.
pref("dom.mozApps.maxLocalId", 10000);