Check key length, if index keys are fixed length

This commit is contained in:
Ingo Weinhold 2011-07-08 23:32:56 +02:00
parent 8db89f6336
commit 08bed1acb7

View File

@ -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))) {