From 7d7bc1e6ffd674afa5e3e51e9242b06ebe3fefdf Mon Sep 17 00:00:00 2001 From: ghidravore Date: Wed, 3 Apr 2019 18:33:43 -0400 Subject: [PATCH] GT-2736 fixed concurrent modification in DataTypeManagerDB --- .../java/ghidra/program/database/data/DataTypeManagerDB.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java index 73d45f4e85..81310f47f5 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java @@ -1111,7 +1111,9 @@ abstract public class DataTypeManagerDB implements DataTypeManager { } else { buildSortedDataTypeList(); - Iterator it = sortedDataTypes.iterator(); + // make copy of sortedDataTypes list before iterating as dt.dataTypeReplaced may + // call back into this class and cause a modification to the sortedDataTypes list. + Iterator it = new ArrayList<>(sortedDataTypes).iterator(); while (it.hasNext()) { DataType dt = it.next(); dt.dataTypeReplaced(existingDt, newDt);