mirror of
https://github.com/OpenKMIP/PyKMIP.git
synced 2025-06-27 17:24:24 +02:00
Fix a bug with attribute index handling in ModifyAttribute
This changes fixes a minor bug with proper attribute index range checking in the server implementation of ModifyAttribute. A corner case that previously slipped through index checking and testing has been closed. An existing unit test has been modified to fix this bug. Partially implements #547
This commit is contained in:
parent
e5281cbd35
commit
cd8d66fe91
@ -1876,7 +1876,7 @@ class KmipEngine(object):
|
||||
managed_object,
|
||||
attribute_name
|
||||
)
|
||||
if 0 <= attribute_index <= len(existing_attributes):
|
||||
if 0 <= attribute_index < len(existing_attributes):
|
||||
self._set_attribute_on_managed_object_by_index(
|
||||
managed_object,
|
||||
attribute_name,
|
||||
|
@ -4975,7 +4975,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
attribute=attribute_factory.create_attribute(
|
||||
enums.AttributeType.NAME,
|
||||
"Modified Name",
|
||||
index=3
|
||||
index=1
|
||||
)
|
||||
),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user