baseldap: Fix possible crash in LDAPObject.handle_duplicate_entry

This commit is contained in:
Jan Cholasta 2015-05-15 14:00:54 +00:00
parent 3c86b0ef3e
commit dc668b1b6a

View File

@ -756,7 +756,7 @@ class LDAPObject(Object):
def handle_duplicate_entry(self, *keys): def handle_duplicate_entry(self, *keys):
try: try:
pkey = keys[-1] pkey = keys[-1]
except KeyError: except IndexError:
pkey = '' pkey = ''
raise errors.DuplicateEntry( raise errors.DuplicateEntry(
message=self.already_exists_msg % { message=self.already_exists_msg % {