Fix off-by-one bugs

This fixes warnings from LGTM:

    Off-by-one index comparison against length may lead
    to out-of-bounds read.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-10-26 17:31:42 +02:00
parent 31c3814b0a
commit a226f65aa2
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ OCA = OCA || {};
// for example, BaseDN detector needs the port. The port is typically found
// by the Port Detector. If BaseDN detector was run first, it will not have
// all necessary information. Only after Port Detector was executed…
for (var i = 0; i <= detectors.length; i++) {
for (var i = 0; i < detectors.length; i++) {
model.registerDetector(detectors[i]);
}
@ -61,7 +61,7 @@ OCA = OCA || {};
var view = new OCA.LDAP.Wizard.WizardView(model);
view.init();
view.setModel(model);
for (var j = 0; j <= tabs.length; j++) {
for (var j = 0; j < tabs.length; j++) {
view.registerTab(tabs[j], '#ldapWizard' + (j + 2));
}