Check key length, if index keys are fixed length

This commit is contained in:
Ingo Weinhold
2011-11-25 06:19:28 +01:00
parent 8db89f6336
commit 08bed1acb7
@@ -379,8 +379,9 @@ AttributeIndex::InternalGetIterator()
AbstractIndexIterator*
AttributeIndex::InternalFind(const void* key, size_t length)
{
if (key == NULL)
if (HasFixedKeyLength() && length != KeyLength())
return NULL;
Iterator* iterator = new(std::nothrow) Iterator;
if (iterator != NULL) {
if (!iterator->SetTo(this, TreeKey(key, length))) {