Skip to content

Commit 0810c40

Browse files
jubatusdjubatusd
and
jubatusd
authored
fix : add synchronized on the returned list when traversing it Spliterator (ShiftLeftSecurity#425)
Co-authored-by: jubatusd <[email protected]>
1 parent 0f90909 commit 0810c40

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/java/overflowdb/ReferenceManager.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ private void safelyClearReferences(final List<NodeRef> refsToClear) {
152152
* useful when saving the graph
153153
*/
154154
public void clearAllReferences() {
155-
nodesWriter.writeAndClearBatched(clearableRefs.spliterator(), clearableRefs.size());
156-
logger.debug("cleared all clearable references");
155+
synchronized (clearableRefs){
156+
nodesWriter.writeAndClearBatched(clearableRefs.spliterator(), clearableRefs.size());
157+
logger.debug("cleared all clearable references");
158+
}
157159
}
158160

159161
@Override

0 commit comments

Comments
 (0)