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 54293003ef
commit 6b67f8ec81

View File

@ -172,6 +172,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;
}
}
}