Check key length, if index keys are fixed length
This commit is contained in:
@@ -379,8 +379,9 @@ AttributeIndex::InternalGetIterator()
|
|||||||
AbstractIndexIterator*
|
AbstractIndexIterator*
|
||||||
AttributeIndex::InternalFind(const void* key, size_t length)
|
AttributeIndex::InternalFind(const void* key, size_t length)
|
||||||
{
|
{
|
||||||
if (key == NULL)
|
if (HasFixedKeyLength() && length != KeyLength())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Iterator* iterator = new(std::nothrow) Iterator;
|
Iterator* iterator = new(std::nothrow) Iterator;
|
||||||
if (iterator != NULL) {
|
if (iterator != NULL) {
|
||||||
if (!iterator->SetTo(this, TreeKey(key, length))) {
|
if (!iterator->SetTo(this, TreeKey(key, length))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user