From e1336b7edca1f2ae31e29df78b3ce15d07ae6b22 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Fri, 01 Sep 2006 19:48:33 +0000
Subject: [PATCH] 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.
---
opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java b/opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java
index 5d71300..9087e42 100644
--- a/opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java
+++ b/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();
--
Gitblit v1.10.0