mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

boli
01.48.2006 e1336b7edca1f2ae31e29df78b3ce15d07ae6b22
Fixed bug in matchInitialSubstring() where the lower and upper bounds are both set to the upper bound because they reference the same byte array. An array copy operation is added to create two byte arrays for the lower and upper bounds. 

The previous procedures outlined in issue 618 to reproduce the problem were ran and it now produces the correct result.

Fix for issue 618
1 files modified
6 ■■■■ changed files
opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java 6 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java
@@ -465,7 +465,9 @@
    // Set the upper bound for a range search.
    // We need a key for the upper bound that is of equal length
    // but slightly greater than the lower bound.
    byte[] upper = bytes;
    byte[] upper = new byte[bytes.length];
    System.arraycopy(bytes,0, upper, 0, bytes.length);
    for (int i = upper.length-1; i >= 0; i--)
    {
      if (upper[i] == 0xFF)
@@ -717,8 +719,6 @@
      OrderingMatchingRule orderingRule =
           getAttributeType().getOrderingMatchingRule();
      byte[] normBytes;
      // Set the lower bound for a range search.
      byte[] lower = orderingRule.normalizeValue(lowerValue.getValue()).value();