Fix possible AttributeMap corruption on double removal

Motivation:

When remove0() is called multiple times for an DefaultAttribute it can cause corruption of the internal linked-list structure.

Modifications:

- Ensure remove0() can not cause corruption by null out prev and next references.

Result:

No more corruption possible
This commit is contained in:
Norman Maurer 2015-03-05 14:14:19 +01:00
parent 99c40431b9
commit 0767da12fb

View File

@ -208,6 +208,11 @@ public class DefaultAttributeMap implements AttributeMap {
if (next != null) {
next.prev = prev;
}
// Null out prev and next - this will guard against multiple remove0() calls which may corrupt
// the linked list for the bucket.
prev = null;
next = null;
}
}
}