Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
>
Examples of errors detected by the V602…

Examples of errors detected by the V6025 diagnostic

V6025. Possibly index is out of bound.


Elasticsearch

V6025 Possibly index '(int) x' is out of bounds. BCrypt.java(431)


private static byte char64(char x) {
  if ((int)x < 0 || (int)x > index_64.length)
    return -1;
  return index_64[(int)x];
}

Bouncy Castle

V6025 Possibly index 'i' is out of bounds. HSSTests.java(384)


public void testVectorsFromReference() throws Exception {
    List<LMSigParameters> lmsParameters = new ArrayList<LMSigParameters>();
    List<LMOtsParameters> lmOtsParameters = new ArrayList<LMOtsParameters>();
    ....
    for (String line : lines) {
        ....
        if (line.startsWith("Depth:")) {
            ....
        } else if (line.startsWith("LMType:")) {
            ....
            lmsParameters.add(LMSigParameters.getParametersForType(typ));
        } else if (line.startsWith("LMOtsType:")) {
            ....
            lmOtsParameters.add(LMOtsParameters.getParametersForType(typ));
        }
    }
    ....
    for (int i = 0; i != lmsParameters.size(); i++) {
        lmsParams.add(new LMSParameters(lmsParameters.get(i),
                                        lmOtsParameters.get(i)));
    }
}

ELKI

V6025 Index '1' is out of bounds. GeneratorStatic.java(104)


@Override
public double[] computeMean() {
    // Not supported except for singletons.
    return points.size() == 1 ? points.get(1) : null;
}

Rhino

V6025 Index 'sig1.length - 1' is out of bounds. NativeJavaMethod.java(461)


public class NativeJavaMethod extends BaseFunction {

  private static int preferSignature(Object[] args,
                                     Class<?>[] sig1,
                                     boolean vararg1,
                                     Class<?>[] sig2,
                                     boolean vararg2) {
    int totalPreference = 0;
    for (int j = 0; j < args.length; j++) {
      Class<?> type1 = vararg1 &&
                       j >= sig1.length ? sig1[sig1.length - 1] // <=
                                        : sig1[j];
      Class<?> type2 = vararg2 &&
                       j >= sig2.length ? sig2[sig2.length - 1] // <=
                                        : sig2[j];
      ....
    }
    return totalPreference;
  }
}

Rhino

V6025 Index 'sig2.length - 1' is out of bounds. NativeJavaMethod.java(462)


public class NativeJavaMethod extends BaseFunction {

  private static int preferSignature(Object[] args,
                                     Class<?>[] sig1,
                                     boolean vararg1,
                                     Class<?>[] sig2,
                                     boolean vararg2) {
    int totalPreference = 0;
    for (int j = 0; j < args.length; j++) {
      Class<?> type1 = vararg1 &&
                       j >= sig1.length ? sig1[sig1.length - 1] // <=
                                        : sig1[j];
      Class<?> type2 = vararg2 &&
                       j >= sig2.length ? sig2[sig2.length - 1] // <=
                                        : sig2[j];
      ....
    }
    return totalPreference;
  }
}

Rhino

V6025 Possibly index 'last - 1' is out of bounds. SuperBlock.java(50)


final class SuperBlock {
  ....
  int[] getTrimmedLocals() {
    int last = locals.length - 1;
    while (last >= 0
        && locals[last] == TypeInfo.TOP
        && !TypeInfo.isTwoWords(locals[last - 1])) {         // <=
      last--;
    }
    ....
  }
  ....
}